From e984c3c098bea3c093727ddf19761959a758eb52 Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 11:07:48 -0400 Subject: [PATCH] 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 + +