diff --git a/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in b/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in index ea47440ecfa..c4607cbb799 100755 --- a/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in +++ b/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in @@ -50,7 +50,9 @@ wait_for_network() { i=1 while [ $i -lt 10 ] do - if ip addr show cloudbr0 |grep -w inet > /dev/null 2>&1; then + # Under Ubuntu and Debian libvirt by default creates a bridge called virbr0. + # That's why we want more then 3 lines back from brctl, so that there is a manually created bridge + if [ "$(brctl show|wc -l)" -gt 2 ]; then break else sleep 1 @@ -74,9 +76,8 @@ start() { log_end_msg 1 exit 1 fi - - #FIXME: wait for network - wait_for_network + + wait_for_network if start-stop-daemon --start --quiet \ --pidfile "$PIDFILE" \ diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java index 9f97213aef4..babf0b396d4 100755 --- a/agent/src/com/cloud/agent/Agent.java +++ b/agent/src/com/cloud/agent/Agent.java @@ -245,9 +245,9 @@ public class Agent implements HandlerFactory, IAgentControl { _connection.start(); while (!_connection.isStartup()) { - _shell.getBackoffAlgorithm().waitBeforeRetry(); - _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this); - _connection.start(); + _shell.getBackoffAlgorithm().waitBeforeRetry(); + _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this); + _connection.start(); } } @@ -495,7 +495,7 @@ public class Agent implements HandlerFactory, IAgentControl { _reconnectAllowed = false; answer = new Answer(cmd, true, null); } else if (cmd instanceof MaintainCommand) { - s_logger.debug("Received maintainCommand" ); + s_logger.debug("Received maintainCommand" ); cancelTasks(); _reconnectAllowed = false; answer = new MaintainAnswer((MaintainCommand)cmd); @@ -820,17 +820,17 @@ public class Agent implements HandlerFactory, IAgentControl { } public class AgentRequestHandler extends Task { - public AgentRequestHandler(Task.Type type, Link link, Request req) { + public AgentRequestHandler(Task.Type type, Link link, Request req) { super(type, link, req); } - @Override - protected void doTask(Task task) throws Exception { - Request req = (Request)this.get(); - if (!(req instanceof Response)) { - processRequest(req, task.getLink()); - } - } + @Override + protected void doTask(Task task) throws Exception { + Request req = (Request)this.get(); + if (!(req instanceof Response)) { + processRequest(req, task.getLink()); + } + } } public class ServerHandler extends Task { @@ -853,12 +853,12 @@ public class Agent implements HandlerFactory, IAgentControl { try { request = Request.parse(task.getData()); if (request instanceof Response) { - //It's for pinganswer etc, should be processed immediately. + //It's for pinganswer etc, should be processed immediately. processResponse((Response) request, task.getLink()); } else { - //put the requests from mgt server into another thread pool, as the request may take a longer time to finish. Don't block the NIO main thread pool + //put the requests from mgt server into another thread pool, as the request may take a longer time to finish. Don't block the NIO main thread pool //processRequest(request, task.getLink()); - _executor.execute(new AgentRequestHandler(this.getType(), this.getLink(), request)); + _executor.execute(new AgentRequestHandler(this.getType(), this.getLink(), request)); } } catch (final ClassNotFoundException e) { s_logger.error("Unable to find this request "); diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java index 49073e19e70..941f09498b4 100644 --- a/agent/src/com/cloud/agent/AgentShell.java +++ b/agent/src/com/cloud/agent/AgentShell.java @@ -58,580 +58,580 @@ import com.cloud.utils.net.MacAddress; import com.cloud.utils.script.Script; public class AgentShell implements IAgentShell { - private static final Logger s_logger = Logger.getLogger(AgentShell.class - .getName()); - - private final Properties _properties = new Properties(); - private final Map _cmdLineProperties = new HashMap(); - private StorageComponent _storage; - private BackoffAlgorithm _backoff; - private String _version; - private String _zone; - private String _pod; - private String _host; - private String _privateIp; - private int _port; - private int _proxyPort; - private int _workers; - private String _guid; - private int _nextAgentId = 1; - private volatile boolean _exit = false; - private int _pingRetries; - private Thread _consoleProxyMain = null; - private final List _agents = new ArrayList(); - - public AgentShell() { - } - - @Override - public Properties getProperties() { - return _properties; - } - - @Override - public BackoffAlgorithm getBackoffAlgorithm() { - return _backoff; - } - - @Override - public int getPingRetries() { - return _pingRetries; - } - - @Override - public String getVersion() { - return _version; - } - - @Override - public String getZone() { - return _zone; - } - - @Override - public String getPod() { - return _pod; - } - - @Override - public String getHost() { - return _host; - } - - @Override - public String getPrivateIp() { - return _privateIp; - } - - @Override - public int getPort() { - return _port; - } - - @Override - public int getProxyPort() { - return _proxyPort; - } - - @Override - public int getWorkers() { - return _workers; - } - - @Override - public String getGuid() { - return _guid; - } - - public Map getCmdLineProperties() { - return _cmdLineProperties; - } - - public String getProperty(String prefix, String name) { - if (prefix != null) - return _properties.getProperty(prefix + "." + name); - - return _properties.getProperty(name); - } - - @Override - public String getPersistentProperty(String prefix, String name) { - if (prefix != null) - return _storage.get(prefix + "." + name); - return _storage.get(name); - } - - @Override - public void setPersistentProperty(String prefix, String name, String value) { - if (prefix != null) - _storage.persist(prefix + "." + name, value); - else - _storage.persist(name, value); - } - - @Override - public void upgradeAgent(final String url) { - s_logger.info("Updating agent with binary from " + url); - synchronized (this) { - final Class c = this.getClass(); - String path = c.getResource(c.getSimpleName() + ".class") - .toExternalForm(); - final int begin = path.indexOf(File.separator); - int end = path.lastIndexOf("!"); - end = path.lastIndexOf(File.separator, end); - path = path.substring(begin, end); - - s_logger.debug("Current binaries reside at " + path); - - File file = null; - try { - file = File.createTempFile("agent-", - "-" + Long.toString(new Date().getTime())); - wget(url, file); - } catch (final IOException e) { - s_logger.warn( - "Exception while downloading agent update package, ", e); - throw new CloudRuntimeException("Unable to update from " + url - + ", exception:" + e.getMessage(), e); - } - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Unzipping " + file.getAbsolutePath() + " to " - + path); - } - - final Script unzip = new Script("unzip", 120000, s_logger); - unzip.add("-o", "-q"); // overwrite and quiet - unzip.add(file.getAbsolutePath()); - unzip.add("-d", path); - - final String result = unzip.execute(); - if (result != null) { - throw new CloudRuntimeException( - "Unable to unzip the retrieved file: " + result); - } - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Closing the connection to the management server"); - } - } - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Exiting to start the new agent."); - } - System.exit(ExitStatus.Upgrade.value()); - } - - public static void wget(String url, File file) throws IOException { - final HttpClient client = new HttpClient(); - final GetMethod method = new GetMethod(url); - int response; - response = client.executeMethod(method); - if (response != HttpURLConnection.HTTP_OK) { - s_logger.warn("Retrieving from " + url + " gives response code: " - + response); - throw new CloudRuntimeException("Unable to download from " + url - + ". Response code is " + response); - } - - final InputStream is = method.getResponseBodyAsStream(); - s_logger.debug("Downloading content into " + file.getAbsolutePath()); - - final FileOutputStream fos = new FileOutputStream(file); - byte[] buffer = new byte[4096]; - int len = 0; - while ((len = is.read(buffer)) > 0) - fos.write(buffer, 0, len); - fos.close(); - - try { - is.close(); - } catch (IOException e) { - s_logger.warn("Exception while closing download stream from " - + url + ", ", e); - } - } - - private void loadProperties() throws ConfigurationException { - final File file = PropertiesUtil.findConfigFile("agent.properties"); - if (file == null) { - throw new ConfigurationException("Unable to find agent.properties."); - } - - s_logger.info("agent.properties found at " + file.getAbsolutePath()); - - try { - _properties.load(new FileInputStream(file)); - } catch (final FileNotFoundException ex) { - throw new CloudRuntimeException("Cannot find the file: " - + file.getAbsolutePath(), ex); - } catch (final IOException ex) { - throw new CloudRuntimeException("IOException in reading " - + file.getAbsolutePath(), ex); - } - } - - protected boolean parseCommand(final String[] args) - throws ConfigurationException { - String host = null; - String workers = null; - String port = null; - String zone = null; - String pod = null; - String guid = null; - for (int i = 0; i < args.length; i++) { - final String[] tokens = args[i].split("="); - if (tokens.length != 2) { - System.out.println("Invalid Parameter: " + args[i]); - continue; - } - - // save command line properties - _cmdLineProperties.put(tokens[0], tokens[1]); - - if (tokens[0].equalsIgnoreCase("port")) { - port = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("threads")) { - workers = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("host")) { - host = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("zone")) { - zone = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("pod")) { - pod = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("guid")) { - guid = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("eth1ip")) { - _privateIp = tokens[1]; - } - } - - if (port == null) { - port = getProperty(null, "port"); - } - - _port = NumbersUtil.parseInt(port, 8250); - - _proxyPort = NumbersUtil.parseInt( - getProperty(null, "consoleproxy.httpListenPort"), 443); - - if (workers == null) { - workers = getProperty(null, "workers"); - } - - _workers = NumbersUtil.parseInt(workers, 5); - - if (host == null) { - host = getProperty(null, "host"); - } - - if (host == null) { - host = "localhost"; - } - _host = host; - - if (zone != null) - _zone = zone; - else - _zone = getProperty(null, "zone"); - if (_zone == null || (_zone.startsWith("@") && _zone.endsWith("@"))) { - _zone = "default"; - } - - if (pod != null) - _pod = pod; - else - _pod = getProperty(null, "pod"); - if (_pod == null || (_pod.startsWith("@") && _pod.endsWith("@"))) { - _pod = "default"; - } - - if (_host == null || (_host.startsWith("@") && _host.endsWith("@"))) { - throw new ConfigurationException( - "Host is not configured correctly: " + _host); - } - - final String retries = getProperty(null, "ping.retries"); - _pingRetries = NumbersUtil.parseInt(retries, 5); - - String value = getProperty(null, "developer"); - boolean developer = Boolean.parseBoolean(value); - - if (guid != null) - _guid = guid; - else - _guid = getProperty(null, "guid"); - if (_guid == null) { - if (!developer) { - throw new ConfigurationException("Unable to find the guid"); - } - _guid = UUID.randomUUID().toString(); - } - - return true; - } - - private void init(String[] args) throws ConfigurationException { - - final ComponentLocator locator = ComponentLocator.getLocator("agent"); - - final Class c = this.getClass(); - _version = c.getPackage().getImplementationVersion(); - if (_version == null) { - throw new CloudRuntimeException( - "Unable to find the implementation version of this agent"); - } - s_logger.info("Implementation Version is " + _version); - - parseCommand(args); - - _storage = locator.getManager(StorageComponent.class); - if (_storage == null) { - s_logger.info("Defaulting to using properties file for storage"); - _storage = new PropertiesStorage(); - _storage.configure("Storage", new HashMap()); - } - - // merge with properties from command line to let resource access - // command line parameters - for (Map.Entry cmdLineProp : getCmdLineProperties() - .entrySet()) { - _properties.put(cmdLineProp.getKey(), cmdLineProp.getValue()); - } - - final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class); - final Enumeration en = adapters.enumeration(); - while (en.hasMoreElements()) { - _backoff = (BackoffAlgorithm) en.nextElement(); - break; - } - if (en.hasMoreElements()) { - s_logger.info("More than one backoff algorithm specified. Using the first one "); - } - - if (_backoff == null) { - s_logger.info("Defaulting to the constant time backoff algorithm"); - _backoff = new ConstantTimeBackoff(); - _backoff.configure("ConstantTimeBackoff", - new HashMap()); - } - } - - private void launchAgent() throws ConfigurationException { - String resourceClassNames = getProperty(null, "resource"); - s_logger.trace("resource=" + resourceClassNames); - if (resourceClassNames != null) { - launchAgentFromClassInfo(resourceClassNames); - return; - } - - launchAgentFromTypeInfo(); - } - - private boolean needConsoleProxy() { - for (Agent agent : _agents) { - if (agent.getResource().getType().equals(Host.Type.ConsoleProxy) - || agent.getResource().getType().equals(Host.Type.Routing)) - return true; - } - return false; - } - - private int getConsoleProxyPort() { - int port = NumbersUtil.parseInt( - getProperty(null, "consoleproxy.httpListenPort"), 443); - return port; - } - - private void openPortWithIptables(int port) { - // TODO - } - - private void launchConsoleProxy() throws ConfigurationException { - if (!needConsoleProxy()) { - if (s_logger.isInfoEnabled()) - s_logger.info("Storage only agent, no need to start console proxy on it"); - return; - } - - int port = getConsoleProxyPort(); - openPortWithIptables(port); - - _consoleProxyMain = new Thread(new Runnable() { - public void run() { - try { - Class consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy"); - - try { - Method method = consoleProxyClazz.getMethod("start", - Properties.class); - method.invoke(null, _properties); - } catch (SecurityException e) { - s_logger.error("Unable to launch console proxy due to SecurityException"); - System.exit(ExitStatus.Error.value()); - } catch (NoSuchMethodException e) { - s_logger.error("Unable to launch console proxy due to NoSuchMethodException"); - System.exit(ExitStatus.Error.value()); - } catch (IllegalArgumentException e) { - s_logger.error("Unable to launch console proxy due to IllegalArgumentException"); - System.exit(ExitStatus.Error.value()); - } catch (IllegalAccessException e) { - s_logger.error("Unable to launch console proxy due to IllegalAccessException"); - System.exit(ExitStatus.Error.value()); - } catch (InvocationTargetException e) { - s_logger.error("Unable to launch console proxy due to InvocationTargetException"); - System.exit(ExitStatus.Error.value()); - } - } catch (final ClassNotFoundException e) { - s_logger.error("Unable to launch console proxy due to ClassNotFoundException"); - System.exit(ExitStatus.Error.value()); - } - } - }, "Console-Proxy-Main"); - _consoleProxyMain.setDaemon(true); - _consoleProxyMain.start(); - } - - private void launchAgentFromClassInfo(String resourceClassNames) - throws ConfigurationException { - String[] names = resourceClassNames.split("\\|"); - for (String name : names) { - Class impl; - try { - impl = Class.forName(name); - final Constructor constructor = impl - .getDeclaredConstructor(); - constructor.setAccessible(true); - ServerResource resource = (ServerResource) constructor - .newInstance(); - launchAgent(getNextAgentId(), resource); - } catch (final ClassNotFoundException e) { - throw new ConfigurationException("Resource class not found: " - + name + " due to: " + e.toString()); - } catch (final SecurityException e) { - throw new ConfigurationException( - "Security excetion when loading resource: " + name - + " due to: " + e.toString()); - } catch (final NoSuchMethodException e) { - throw new ConfigurationException( - "Method not found excetion when loading resource: " - + name + " due to: " + e.toString()); - } catch (final IllegalArgumentException e) { - throw new ConfigurationException( - "Illegal argument excetion when loading resource: " - + name + " due to: " + e.toString()); - } catch (final InstantiationException e) { - throw new ConfigurationException( - "Instantiation excetion when loading resource: " + name - + " due to: " + e.toString()); - } catch (final IllegalAccessException e) { - throw new ConfigurationException( - "Illegal access exception when loading resource: " - + name + " due to: " + e.toString()); - } catch (final InvocationTargetException e) { - throw new ConfigurationException( - "Invocation target exception when loading resource: " - + name + " due to: " + e.toString()); - } - } - } - - private void launchAgentFromTypeInfo() throws ConfigurationException { - String typeInfo = getProperty(null, "type"); - if (typeInfo == null) { - s_logger.error("Unable to retrieve the type"); - throw new ConfigurationException( - "Unable to retrieve the type of this agent."); - } - s_logger.trace("Launching agent based on type=" + typeInfo); - } - - private void launchAgent(int localAgentId, ServerResource resource) - throws ConfigurationException { - // we don't track agent after it is launched for now - Agent agent = new Agent(this, localAgentId, resource); - _agents.add(agent); - agent.start(); - } - - public synchronized int getNextAgentId() { - return _nextAgentId++; - } - - private void run(String[] args) { - try { - System.setProperty("java.net.preferIPv4Stack", "true"); - - loadProperties(); - init(args); - - String instance = getProperty(null, "instance"); - if (instance == null) { - if (Boolean.parseBoolean(getProperty(null, "developer"))) { - instance = UUID.randomUUID().toString(); - } else { - instance = ""; - } - } else { - instance += "."; - } - - String pidDir = getProperty(null, "piddir"); - - final String run = "agent." + instance + "pid"; - s_logger.debug("Checking to see if " + run + "exists."); - ProcessUtil.pidCheck(pidDir, run); - - launchAgent(); - - // - // For both KVM & Xen-Server hypervisor, we have switched to - // VM-based console proxy solution, disable launching - // of console proxy here - // - // launchConsoleProxy(); - // - - try { - while (!_exit) - Thread.sleep(1000); - } catch (InterruptedException e) { - } - - } catch (final ConfigurationException e) { - s_logger.error("Unable to start agent: " + e.getMessage()); - System.out.println("Unable to start agent: " + e.getMessage()); - System.exit(ExitStatus.Configuration.value()); - } catch (final Exception e) { - s_logger.error("Unable to start agent: ", e); - System.out.println("Unable to start agent: " + e.getMessage()); - System.exit(ExitStatus.Error.value()); - } - } - - public void stop() { - _exit = true; - if (_consoleProxyMain != null) { - _consoleProxyMain.interrupt(); - } - } - - public static void main(String[] args) { - AgentShell shell = new AgentShell(); - Runtime.getRuntime().addShutdownHook(new ShutdownThread(shell)); - shell.run(args); - } - - private static class ShutdownThread extends Thread { - AgentShell _shell; - - public ShutdownThread(AgentShell shell) { - this._shell = shell; - } - - @Override - public void run() { - _shell.stop(); - } - } + private static final Logger s_logger = Logger.getLogger(AgentShell.class + .getName()); + + private final Properties _properties = new Properties(); + private final Map _cmdLineProperties = new HashMap(); + private StorageComponent _storage; + private BackoffAlgorithm _backoff; + private String _version; + private String _zone; + private String _pod; + private String _host; + private String _privateIp; + private int _port; + private int _proxyPort; + private int _workers; + private String _guid; + private int _nextAgentId = 1; + private volatile boolean _exit = false; + private int _pingRetries; + private Thread _consoleProxyMain = null; + private final List _agents = new ArrayList(); + + public AgentShell() { + } + + @Override + public Properties getProperties() { + return _properties; + } + + @Override + public BackoffAlgorithm getBackoffAlgorithm() { + return _backoff; + } + + @Override + public int getPingRetries() { + return _pingRetries; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public String getZone() { + return _zone; + } + + @Override + public String getPod() { + return _pod; + } + + @Override + public String getHost() { + return _host; + } + + @Override + public String getPrivateIp() { + return _privateIp; + } + + @Override + public int getPort() { + return _port; + } + + @Override + public int getProxyPort() { + return _proxyPort; + } + + @Override + public int getWorkers() { + return _workers; + } + + @Override + public String getGuid() { + return _guid; + } + + public Map getCmdLineProperties() { + return _cmdLineProperties; + } + + public String getProperty(String prefix, String name) { + if (prefix != null) + return _properties.getProperty(prefix + "." + name); + + return _properties.getProperty(name); + } + + @Override + public String getPersistentProperty(String prefix, String name) { + if (prefix != null) + return _storage.get(prefix + "." + name); + return _storage.get(name); + } + + @Override + public void setPersistentProperty(String prefix, String name, String value) { + if (prefix != null) + _storage.persist(prefix + "." + name, value); + else + _storage.persist(name, value); + } + + @Override + public void upgradeAgent(final String url) { + s_logger.info("Updating agent with binary from " + url); + synchronized (this) { + final Class c = this.getClass(); + String path = c.getResource(c.getSimpleName() + ".class") + .toExternalForm(); + final int begin = path.indexOf(File.separator); + int end = path.lastIndexOf("!"); + end = path.lastIndexOf(File.separator, end); + path = path.substring(begin, end); + + s_logger.debug("Current binaries reside at " + path); + + File file = null; + try { + file = File.createTempFile("agent-", + "-" + Long.toString(new Date().getTime())); + wget(url, file); + } catch (final IOException e) { + s_logger.warn( + "Exception while downloading agent update package, ", e); + throw new CloudRuntimeException("Unable to update from " + url + + ", exception:" + e.getMessage(), e); + } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Unzipping " + file.getAbsolutePath() + " to " + + path); + } + + final Script unzip = new Script("unzip", 120000, s_logger); + unzip.add("-o", "-q"); // overwrite and quiet + unzip.add(file.getAbsolutePath()); + unzip.add("-d", path); + + final String result = unzip.execute(); + if (result != null) { + throw new CloudRuntimeException( + "Unable to unzip the retrieved file: " + result); + } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Closing the connection to the management server"); + } + } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Exiting to start the new agent."); + } + System.exit(ExitStatus.Upgrade.value()); + } + + public static void wget(String url, File file) throws IOException { + final HttpClient client = new HttpClient(); + final GetMethod method = new GetMethod(url); + int response; + response = client.executeMethod(method); + if (response != HttpURLConnection.HTTP_OK) { + s_logger.warn("Retrieving from " + url + " gives response code: " + + response); + throw new CloudRuntimeException("Unable to download from " + url + + ". Response code is " + response); + } + + final InputStream is = method.getResponseBodyAsStream(); + s_logger.debug("Downloading content into " + file.getAbsolutePath()); + + final FileOutputStream fos = new FileOutputStream(file); + byte[] buffer = new byte[4096]; + int len = 0; + while ((len = is.read(buffer)) > 0) + fos.write(buffer, 0, len); + fos.close(); + + try { + is.close(); + } catch (IOException e) { + s_logger.warn("Exception while closing download stream from " + + url + ", ", e); + } + } + + private void loadProperties() throws ConfigurationException { + final File file = PropertiesUtil.findConfigFile("agent.properties"); + if (file == null) { + throw new ConfigurationException("Unable to find agent.properties."); + } + + s_logger.info("agent.properties found at " + file.getAbsolutePath()); + + try { + _properties.load(new FileInputStream(file)); + } catch (final FileNotFoundException ex) { + throw new CloudRuntimeException("Cannot find the file: " + + file.getAbsolutePath(), ex); + } catch (final IOException ex) { + throw new CloudRuntimeException("IOException in reading " + + file.getAbsolutePath(), ex); + } + } + + protected boolean parseCommand(final String[] args) + throws ConfigurationException { + String host = null; + String workers = null; + String port = null; + String zone = null; + String pod = null; + String guid = null; + for (int i = 0; i < args.length; i++) { + final String[] tokens = args[i].split("="); + if (tokens.length != 2) { + System.out.println("Invalid Parameter: " + args[i]); + continue; + } + + // save command line properties + _cmdLineProperties.put(tokens[0], tokens[1]); + + if (tokens[0].equalsIgnoreCase("port")) { + port = tokens[1]; + } else if (tokens[0].equalsIgnoreCase("threads")) { + workers = tokens[1]; + } else if (tokens[0].equalsIgnoreCase("host")) { + host = tokens[1]; + } else if (tokens[0].equalsIgnoreCase("zone")) { + zone = tokens[1]; + } else if (tokens[0].equalsIgnoreCase("pod")) { + pod = tokens[1]; + } else if (tokens[0].equalsIgnoreCase("guid")) { + guid = tokens[1]; + } else if (tokens[0].equalsIgnoreCase("eth1ip")) { + _privateIp = tokens[1]; + } + } + + if (port == null) { + port = getProperty(null, "port"); + } + + _port = NumbersUtil.parseInt(port, 8250); + + _proxyPort = NumbersUtil.parseInt( + getProperty(null, "consoleproxy.httpListenPort"), 443); + + if (workers == null) { + workers = getProperty(null, "workers"); + } + + _workers = NumbersUtil.parseInt(workers, 5); + + if (host == null) { + host = getProperty(null, "host"); + } + + if (host == null) { + host = "localhost"; + } + _host = host; + + if (zone != null) + _zone = zone; + else + _zone = getProperty(null, "zone"); + if (_zone == null || (_zone.startsWith("@") && _zone.endsWith("@"))) { + _zone = "default"; + } + + if (pod != null) + _pod = pod; + else + _pod = getProperty(null, "pod"); + if (_pod == null || (_pod.startsWith("@") && _pod.endsWith("@"))) { + _pod = "default"; + } + + if (_host == null || (_host.startsWith("@") && _host.endsWith("@"))) { + throw new ConfigurationException( + "Host is not configured correctly: " + _host); + } + + final String retries = getProperty(null, "ping.retries"); + _pingRetries = NumbersUtil.parseInt(retries, 5); + + String value = getProperty(null, "developer"); + boolean developer = Boolean.parseBoolean(value); + + if (guid != null) + _guid = guid; + else + _guid = getProperty(null, "guid"); + if (_guid == null) { + if (!developer) { + throw new ConfigurationException("Unable to find the guid"); + } + _guid = UUID.randomUUID().toString(); + } + + return true; + } + + private void init(String[] args) throws ConfigurationException { + + final ComponentLocator locator = ComponentLocator.getLocator("agent"); + + final Class c = this.getClass(); + _version = c.getPackage().getImplementationVersion(); + if (_version == null) { + throw new CloudRuntimeException( + "Unable to find the implementation version of this agent"); + } + s_logger.info("Implementation Version is " + _version); + + parseCommand(args); + + _storage = locator.getManager(StorageComponent.class); + if (_storage == null) { + s_logger.info("Defaulting to using properties file for storage"); + _storage = new PropertiesStorage(); + _storage.configure("Storage", new HashMap()); + } + + // merge with properties from command line to let resource access + // command line parameters + for (Map.Entry cmdLineProp : getCmdLineProperties() + .entrySet()) { + _properties.put(cmdLineProp.getKey(), cmdLineProp.getValue()); + } + + final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class); + final Enumeration en = adapters.enumeration(); + while (en.hasMoreElements()) { + _backoff = (BackoffAlgorithm) en.nextElement(); + break; + } + if (en.hasMoreElements()) { + s_logger.info("More than one backoff algorithm specified. Using the first one "); + } + + if (_backoff == null) { + s_logger.info("Defaulting to the constant time backoff algorithm"); + _backoff = new ConstantTimeBackoff(); + _backoff.configure("ConstantTimeBackoff", + new HashMap()); + } + } + + private void launchAgent() throws ConfigurationException { + String resourceClassNames = getProperty(null, "resource"); + s_logger.trace("resource=" + resourceClassNames); + if (resourceClassNames != null) { + launchAgentFromClassInfo(resourceClassNames); + return; + } + + launchAgentFromTypeInfo(); + } + + private boolean needConsoleProxy() { + for (Agent agent : _agents) { + if (agent.getResource().getType().equals(Host.Type.ConsoleProxy) + || agent.getResource().getType().equals(Host.Type.Routing)) + return true; + } + return false; + } + + private int getConsoleProxyPort() { + int port = NumbersUtil.parseInt( + getProperty(null, "consoleproxy.httpListenPort"), 443); + return port; + } + + private void openPortWithIptables(int port) { + // TODO + } + + private void launchConsoleProxy() throws ConfigurationException { + if (!needConsoleProxy()) { + if (s_logger.isInfoEnabled()) + s_logger.info("Storage only agent, no need to start console proxy on it"); + return; + } + + int port = getConsoleProxyPort(); + openPortWithIptables(port); + + _consoleProxyMain = new Thread(new Runnable() { + public void run() { + try { + Class consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy"); + + try { + Method method = consoleProxyClazz.getMethod("start", + Properties.class); + method.invoke(null, _properties); + } catch (SecurityException e) { + s_logger.error("Unable to launch console proxy due to SecurityException"); + System.exit(ExitStatus.Error.value()); + } catch (NoSuchMethodException e) { + s_logger.error("Unable to launch console proxy due to NoSuchMethodException"); + System.exit(ExitStatus.Error.value()); + } catch (IllegalArgumentException e) { + s_logger.error("Unable to launch console proxy due to IllegalArgumentException"); + System.exit(ExitStatus.Error.value()); + } catch (IllegalAccessException e) { + s_logger.error("Unable to launch console proxy due to IllegalAccessException"); + System.exit(ExitStatus.Error.value()); + } catch (InvocationTargetException e) { + s_logger.error("Unable to launch console proxy due to InvocationTargetException"); + System.exit(ExitStatus.Error.value()); + } + } catch (final ClassNotFoundException e) { + s_logger.error("Unable to launch console proxy due to ClassNotFoundException"); + System.exit(ExitStatus.Error.value()); + } + } + }, "Console-Proxy-Main"); + _consoleProxyMain.setDaemon(true); + _consoleProxyMain.start(); + } + + private void launchAgentFromClassInfo(String resourceClassNames) + throws ConfigurationException { + String[] names = resourceClassNames.split("\\|"); + for (String name : names) { + Class impl; + try { + impl = Class.forName(name); + final Constructor constructor = impl + .getDeclaredConstructor(); + constructor.setAccessible(true); + ServerResource resource = (ServerResource) constructor + .newInstance(); + launchAgent(getNextAgentId(), resource); + } catch (final ClassNotFoundException e) { + throw new ConfigurationException("Resource class not found: " + + name + " due to: " + e.toString()); + } catch (final SecurityException e) { + throw new ConfigurationException( + "Security excetion when loading resource: " + name + + " due to: " + e.toString()); + } catch (final NoSuchMethodException e) { + throw new ConfigurationException( + "Method not found excetion when loading resource: " + + name + " due to: " + e.toString()); + } catch (final IllegalArgumentException e) { + throw new ConfigurationException( + "Illegal argument excetion when loading resource: " + + name + " due to: " + e.toString()); + } catch (final InstantiationException e) { + throw new ConfigurationException( + "Instantiation excetion when loading resource: " + name + + " due to: " + e.toString()); + } catch (final IllegalAccessException e) { + throw new ConfigurationException( + "Illegal access exception when loading resource: " + + name + " due to: " + e.toString()); + } catch (final InvocationTargetException e) { + throw new ConfigurationException( + "Invocation target exception when loading resource: " + + name + " due to: " + e.toString()); + } + } + } + + private void launchAgentFromTypeInfo() throws ConfigurationException { + String typeInfo = getProperty(null, "type"); + if (typeInfo == null) { + s_logger.error("Unable to retrieve the type"); + throw new ConfigurationException( + "Unable to retrieve the type of this agent."); + } + s_logger.trace("Launching agent based on type=" + typeInfo); + } + + private void launchAgent(int localAgentId, ServerResource resource) + throws ConfigurationException { + // we don't track agent after it is launched for now + Agent agent = new Agent(this, localAgentId, resource); + _agents.add(agent); + agent.start(); + } + + public synchronized int getNextAgentId() { + return _nextAgentId++; + } + + private void run(String[] args) { + try { + System.setProperty("java.net.preferIPv4Stack", "true"); + + loadProperties(); + init(args); + + String instance = getProperty(null, "instance"); + if (instance == null) { + if (Boolean.parseBoolean(getProperty(null, "developer"))) { + instance = UUID.randomUUID().toString(); + } else { + instance = ""; + } + } else { + instance += "."; + } + + String pidDir = getProperty(null, "piddir"); + + final String run = "agent." + instance + "pid"; + s_logger.debug("Checking to see if " + run + "exists."); + ProcessUtil.pidCheck(pidDir, run); + + launchAgent(); + + // + // For both KVM & Xen-Server hypervisor, we have switched to + // VM-based console proxy solution, disable launching + // of console proxy here + // + // launchConsoleProxy(); + // + + try { + while (!_exit) + Thread.sleep(1000); + } catch (InterruptedException e) { + } + + } catch (final ConfigurationException e) { + s_logger.error("Unable to start agent: " + e.getMessage()); + System.out.println("Unable to start agent: " + e.getMessage()); + System.exit(ExitStatus.Configuration.value()); + } catch (final Exception e) { + s_logger.error("Unable to start agent: ", e); + System.out.println("Unable to start agent: " + e.getMessage()); + System.exit(ExitStatus.Error.value()); + } + } + + public void stop() { + _exit = true; + if (_consoleProxyMain != null) { + _consoleProxyMain.interrupt(); + } + } + + public static void main(String[] args) { + AgentShell shell = new AgentShell(); + Runtime.getRuntime().addShutdownHook(new ShutdownThread(shell)); + shell.run(args); + } + + private static class ShutdownThread extends Thread { + AgentShell _shell; + + public ShutdownThread(AgentShell shell) { + this._shell = shell; + } + + @Override + public void run() { + _shell.stop(); + } + } } diff --git a/agent/src/com/cloud/agent/IAgentShell.java b/agent/src/com/cloud/agent/IAgentShell.java index bd0b976354d..93aaa00c733 100644 --- a/agent/src/com/cloud/agent/IAgentShell.java +++ b/agent/src/com/cloud/agent/IAgentShell.java @@ -22,35 +22,35 @@ import java.util.Properties; import com.cloud.utils.backoff.BackoffAlgorithm; public interface IAgentShell { - public Map getCmdLineProperties(); + public Map getCmdLineProperties(); - public Properties getProperties(); + public Properties getProperties(); - public String getPersistentProperty(String prefix, String name); + public String getPersistentProperty(String prefix, String name); - public void setPersistentProperty(String prefix, String name, String value); + public void setPersistentProperty(String prefix, String name, String value); - public String getHost(); + public String getHost(); - public String getPrivateIp(); + public String getPrivateIp(); - public int getPort(); + public int getPort(); - public int getWorkers(); + public int getWorkers(); - public int getProxyPort(); + public int getProxyPort(); - public String getGuid(); + public String getGuid(); - public String getZone(); + public String getZone(); - public String getPod(); + public String getPod(); - public BackoffAlgorithm getBackoffAlgorithm(); + public BackoffAlgorithm getBackoffAlgorithm(); - public int getPingRetries(); + public int getPingRetries(); - public void upgradeAgent(final String url); + public void upgradeAgent(final String url); - public String getVersion(); + public String getVersion(); } diff --git a/agent/src/com/cloud/agent/configuration/AgentComponentLibraryBase.java b/agent/src/com/cloud/agent/configuration/AgentComponentLibraryBase.java index b05883446b2..058aefa9252 100755 --- a/agent/src/com/cloud/agent/configuration/AgentComponentLibraryBase.java +++ b/agent/src/com/cloud/agent/configuration/AgentComponentLibraryBase.java @@ -27,50 +27,50 @@ import com.cloud.utils.component.PluggableService; import com.cloud.utils.db.GenericDao; public class AgentComponentLibraryBase extends ComponentLibraryBase { - @Override - public Map>> getDaos() { - return null; - } + @Override + public Map>> getDaos() { + return null; + } - @Override - public Map> getManagers() { - if (_managers.size() == 0) { - populateManagers(); - } - return _managers; - } + @Override + public Map> getManagers() { + if (_managers.size() == 0) { + populateManagers(); + } + return _managers; + } - @Override - public Map>> getAdapters() { - if (_adapters.size() == 0) { - populateAdapters(); - } - return _adapters; - } + @Override + public Map>> getAdapters() { + if (_adapters.size() == 0) { + populateAdapters(); + } + return _adapters; + } - @Override - public Map, Class> getFactories() { - return null; - } + @Override + public Map, Class> getFactories() { + return null; + } - protected void populateManagers() { - // addManager("StackMaidManager", StackMaidManagerImpl.class); - } + protected void populateManagers() { + // addManager("StackMaidManager", StackMaidManagerImpl.class); + } - protected void populateAdapters() { + protected void populateAdapters() { - } + } - protected void populateServices() { + protected void populateServices() { - } + } - @Override - public Map> getPluggableServices() { - if (_pluggableServices.size() == 0) { - populateServices(); - } - return _pluggableServices; - } + @Override + public Map> getPluggableServices() { + if (_pluggableServices.size() == 0) { + populateServices(); + } + return _pluggableServices; + } } diff --git a/agent/src/com/cloud/agent/dao/StorageComponent.java b/agent/src/com/cloud/agent/dao/StorageComponent.java index 576982f7078..afb9467ee50 100755 --- a/agent/src/com/cloud/agent/dao/StorageComponent.java +++ b/agent/src/com/cloud/agent/dao/StorageComponent.java @@ -22,7 +22,7 @@ import com.cloud.utils.component.Manager; * */ public interface StorageComponent extends Manager { - String get(String key); + String get(String key); - void persist(String key, String value); + void persist(String key, String value); } diff --git a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java index e3598a90f90..b94ae83fdc2 100755 --- a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java +++ b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java @@ -39,92 +39,92 @@ import com.cloud.utils.PropertiesUtil; **/ @Local(value = { StorageComponent.class }) public class PropertiesStorage implements StorageComponent { - private static final Logger s_logger = Logger - .getLogger(PropertiesStorage.class); - Properties _properties = new Properties(); - File _file; - String _name; + private static final Logger s_logger = Logger + .getLogger(PropertiesStorage.class); + Properties _properties = new Properties(); + File _file; + String _name; - @Override - public synchronized String get(String key) { - return _properties.getProperty(key); - } + @Override + public synchronized String get(String key) { + return _properties.getProperty(key); + } - @Override - public synchronized void persist(String key, String value) { - _properties.setProperty(key, value); - FileOutputStream output = null; - try { - output = new FileOutputStream(_file); - _properties.store(output, _name); - output.flush(); - output.close(); - } catch (FileNotFoundException e) { - s_logger.error("Who deleted the file? ", e); - } catch (IOException e) { - s_logger.error("Uh-oh: ", e); - } finally { - if (output != null) { - try { - output.close(); - } catch (IOException e) { - // ignore. - } - } - } - } + @Override + public synchronized void persist(String key, String value) { + _properties.setProperty(key, value); + FileOutputStream output = null; + try { + output = new FileOutputStream(_file); + _properties.store(output, _name); + output.flush(); + output.close(); + } catch (FileNotFoundException e) { + s_logger.error("Who deleted the file? ", e); + } catch (IOException e) { + s_logger.error("Uh-oh: ", e); + } finally { + if (output != null) { + try { + output.close(); + } catch (IOException e) { + // ignore. + } + } + } + } - @Override - public boolean configure(String name, Map params) { - _name = name; - String path = (String) params.get("path"); - if (path == null) { - path = "agent.properties"; - } + @Override + public boolean configure(String name, Map params) { + _name = name; + String path = (String) params.get("path"); + if (path == null) { + path = "agent.properties"; + } - File file = PropertiesUtil.findConfigFile(path); - if (file == null) { - file = new File(path); - try { - if (!file.createNewFile()) { - s_logger.error("Unable to create _file: " - + file.getAbsolutePath()); - return false; - } - } catch (IOException e) { - s_logger.error( - "Unable to create _file: " + file.getAbsolutePath(), e); - return false; - } - } + File file = PropertiesUtil.findConfigFile(path); + if (file == null) { + file = new File(path); + try { + if (!file.createNewFile()) { + s_logger.error("Unable to create _file: " + + file.getAbsolutePath()); + return false; + } + } catch (IOException e) { + s_logger.error( + "Unable to create _file: " + file.getAbsolutePath(), e); + return false; + } + } - try { - _properties.load(new FileInputStream(file)); - _file = file; - } catch (FileNotFoundException e) { - s_logger.error("How did we get here? ", e); - return false; - } catch (IOException e) { - s_logger.error("IOException: ", e); - return false; - } + try { + _properties.load(new FileInputStream(file)); + _file = file; + } catch (FileNotFoundException e) { + s_logger.error("How did we get here? ", e); + return false; + } catch (IOException e) { + s_logger.error("IOException: ", e); + return false; + } - return true; - } + return true; + } - @Override - public String getName() { - return _name; - } + @Override + public String getName() { + return _name; + } - @Override - public boolean start() { - return true; - } + @Override + public boolean start() { + return true; + } - @Override - public boolean stop() { - return true; - } + @Override + public boolean stop() { + return true; + } } diff --git a/agent/src/com/cloud/agent/dhcp/DhcpPacketParser.java b/agent/src/com/cloud/agent/dhcp/DhcpPacketParser.java deleted file mode 100644 index c25d3906802..00000000000 --- a/agent/src/com/cloud/agent/dhcp/DhcpPacketParser.java +++ /dev/null @@ -1,272 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.agent.dhcp; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Formatter; - -import org.apache.log4j.Logger; -import org.jnetpcap.packet.JMemoryPacket; -import org.jnetpcap.packet.JPacket; -import org.jnetpcap.packet.PcapPacket; -import org.jnetpcap.protocol.lan.Ethernet; -import org.jnetpcap.protocol.lan.IEEE802dot1q; -import org.jnetpcap.protocol.network.Ip4; -import org.jnetpcap.protocol.tcpip.Udp; - -import com.cloud.agent.dhcp.DhcpSnooperImpl.DHCPState; - -public class DhcpPacketParser implements Runnable { - private static final Logger s_logger = Logger - .getLogger(DhcpPacketParser.class); - - private enum DHCPPACKET { - OP(0), HTYPE(1), HLEN(2), HOPS(3), XID(4), SECS(8), FLAGS(10), CIADDR( - 12), YIADDR(16), SIDADDR(20), GIADDR(24), CHADDR(28), SNAME(44), FILE( - 108), MAGIC(236), OPTIONS(240); - int offset; - - DHCPPACKET(int i) { - offset = i; - } - - int getValue() { - return offset; - } - } - - private enum DHCPOPTIONTYPE { - PAD(0), MESSAGETYPE(53), REQUESTEDIP(50), END(255); - int type; - - DHCPOPTIONTYPE(int i) { - type = i; - } - - int getValue() { - return type; - } - } - - private enum DHCPMSGTYPE { - DHCPDISCOVER(1), DHCPOFFER(2), DHCPREQUEST(3), DHCPDECLINE(4), DHCPACK( - 5), DHCPNAK(6), DHCPRELEASE(7), DHCPINFORM(8); - int _type; - - DHCPMSGTYPE(int type) { - _type = type; - } - - int getValue() { - return _type; - } - - public static DHCPMSGTYPE valueOf(int type) { - for (DHCPMSGTYPE t : values()) { - if (type == t.getValue()) { - return t; - } - } - return null; - } - } - - private class DHCPMSG { - DHCPMSGTYPE msgType; - byte[] caddr; - byte[] yaddr; - byte[] chaddr; - byte[] requestedIP; - - public DHCPMSG() { - caddr = new byte[4]; - yaddr = new byte[4]; - chaddr = new byte[6]; - } - } - - private PcapPacket _buffer; - private int _offset; - private int _len; - private DhcpSnooperImpl _manager; - - public DhcpPacketParser(PcapPacket buffer, int offset, int len, - DhcpSnooperImpl manager) { - _buffer = buffer; - _offset = offset; - _len = len; - _manager = manager; - } - - private int getPos(int pos) { - return _offset + pos; - } - - private byte getByte(int offset) { - return _buffer.getByte(getPos(offset)); - } - - private void getByteArray(int offset, byte[] array) { - _buffer.getByteArray(getPos(offset), array); - } - - private long getUInt(int offset) { - return _buffer.getUInt(getPos(offset)); - } - - private DHCPMSG getDhcpMsg() { - long magic = getUInt(DHCPPACKET.MAGIC.getValue()); - if (magic != 0x63538263) { - return null; - } - - DHCPMSG msg = new DHCPMSG(); - - int pos = DHCPPACKET.OPTIONS.getValue(); - while (pos <= _len) { - int type = (int) getByte(pos++) & 0xff; - - if (type == DHCPOPTIONTYPE.END.getValue()) { - break; - } - if (type == DHCPOPTIONTYPE.PAD.getValue()) { - continue; - } - int len = 0; - if (pos <= _len) { - len = ((int) getByte(pos++)) & 0xff; - } - - if (type == DHCPOPTIONTYPE.MESSAGETYPE.getValue() - || type == DHCPOPTIONTYPE.REQUESTEDIP.getValue()) { - /* Read data only if needed */ - byte[] data = null; - if ((len + pos) <= _len) { - data = new byte[len]; - getByteArray(pos, data); - } - - if (type == DHCPOPTIONTYPE.MESSAGETYPE.getValue()) { - msg.msgType = DHCPMSGTYPE.valueOf((int) data[0]); - } else if (type == DHCPOPTIONTYPE.REQUESTEDIP.getValue()) { - msg.requestedIP = data; - } - } - - pos += len; - } - - if (msg.msgType == DHCPMSGTYPE.DHCPREQUEST) { - getByteArray(DHCPPACKET.CHADDR.getValue(), msg.chaddr); - getByteArray(DHCPPACKET.CIADDR.getValue(), msg.caddr); - } else if (msg.msgType == DHCPMSGTYPE.DHCPACK) { - getByteArray(DHCPPACKET.YIADDR.getValue(), msg.yaddr); - } - return msg; - } - - private String formatMacAddress(byte[] mac) { - StringBuffer sb = new StringBuffer(); - Formatter formatter = new Formatter(sb); - for (int i = 0; i < mac.length; i++) { - formatter.format("%02X%s", mac[i], (i < mac.length - 1) ? ":" : ""); - } - return sb.toString(); - } - - private String getDestMacAddress() { - Ethernet ether = new Ethernet(); - if (_buffer.hasHeader(ether)) { - byte[] destMac = ether.destination(); - return formatMacAddress(destMac); - } - return null; - } - - private InetAddress getDHCPServerIP() { - Ip4 ip = new Ip4(); - if (_buffer.hasHeader(ip)) { - try { - return InetAddress.getByAddress(ip.source()); - } catch (UnknownHostException e) { - s_logger.debug("Failed to get dhcp server ip address: " - + e.toString()); - } - } - return null; - } - - @Override - public void run() { - DHCPMSG msg = getDhcpMsg(); - - if (msg == null) { - return; - } - - if (msg.msgType == DHCPMSGTYPE.DHCPACK) { - InetAddress ip = null; - try { - ip = InetAddress.getByAddress(msg.yaddr); - String macAddr = getDestMacAddress(); - _manager.setIPAddr(macAddr, ip, DHCPState.DHCPACKED, - getDHCPServerIP()); - } catch (UnknownHostException e) { - - } - } else if (msg.msgType == DHCPMSGTYPE.DHCPREQUEST) { - InetAddress ip = null; - if (msg.requestedIP != null) { - try { - ip = InetAddress.getByAddress(msg.requestedIP); - } catch (UnknownHostException e) { - } - } - if (ip == null) { - try { - ip = InetAddress.getByAddress(msg.caddr); - } catch (UnknownHostException e) { - } - } - - if (ip != null) { - String macAddr = formatMacAddress(msg.chaddr); - _manager.setIPAddr(macAddr, ip, DHCPState.DHCPREQUESTED, null); - } - } - - } - - private void test() { - JPacket packet = new JMemoryPacket( - Ethernet.ID, - " 06fa 8800 00b3 0656 d200 0027 8100 001a 0800 4500 0156 64bf 0000 4011 f3f2 ac1a 6412 ac1a 649e 0043 0044 0001 0000 0001"); - Ethernet eth = new Ethernet(); - if (packet.hasHeader(eth)) { - System.out.print(" ether:" + eth); - } - IEEE802dot1q vlan = new IEEE802dot1q(); - if (packet.hasHeader(vlan)) { - System.out.print(" vlan: " + vlan); - } - - if (packet.hasHeader(Udp.ID)) { - System.out.print("has udp"); - } - } -} diff --git a/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java b/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java index 53856b665a3..94aa2748cfe 100644 --- a/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java +++ b/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java @@ -31,36 +31,36 @@ import org.apache.log4j.Logger; import com.cloud.utils.concurrency.NamedThreadFactory; public class DhcpProtocolParserServer extends Thread { - private static final Logger s_logger = Logger - .getLogger(DhcpProtocolParserServer.class);; - protected ExecutorService _executor; - private int dhcpServerPort = 67; - private int bufferSize = 300; - protected boolean _running = false; + private static final Logger s_logger = Logger + .getLogger(DhcpProtocolParserServer.class);; + protected ExecutorService _executor; + private int dhcpServerPort = 67; + private int bufferSize = 300; + protected boolean _running = false; - public DhcpProtocolParserServer(int workers) { - _executor = new ThreadPoolExecutor(workers, 10 * workers, 1, - TimeUnit.DAYS, new LinkedBlockingQueue(), - new NamedThreadFactory("DhcpListener")); - _running = true; - } + public DhcpProtocolParserServer(int workers) { + _executor = new ThreadPoolExecutor(workers, 10 * workers, 1, + TimeUnit.DAYS, new LinkedBlockingQueue(), + new NamedThreadFactory("DhcpListener")); + _running = true; + } - public void run() { - while (_running) { - try { - DatagramSocket dhcpSocket = new DatagramSocket(dhcpServerPort, - InetAddress.getByAddress(new byte[] { 0, 0, 0, 0 })); - dhcpSocket.setBroadcast(true); + public void run() { + while (_running) { + try { + DatagramSocket dhcpSocket = new DatagramSocket(dhcpServerPort, + InetAddress.getByAddress(new byte[] { 0, 0, 0, 0 })); + dhcpSocket.setBroadcast(true); - while (true) { - byte[] buf = new byte[bufferSize]; - DatagramPacket dgp = new DatagramPacket(buf, buf.length); - dhcpSocket.receive(dgp); - // _executor.execute(new DhcpPacketParser(buf)); - } - } catch (IOException e) { - s_logger.debug(e.getMessage()); - } - } - } + while (true) { + byte[] buf = new byte[bufferSize]; + DatagramPacket dgp = new DatagramPacket(buf, buf.length); + dhcpSocket.receive(dgp); + // _executor.execute(new DhcpPacketParser(buf)); + } + } catch (IOException e) { + s_logger.debug(e.getMessage()); + } + } + } } diff --git a/agent/src/com/cloud/agent/dhcp/DhcpSnooper.java b/agent/src/com/cloud/agent/dhcp/DhcpSnooper.java index 36b9c24f493..e25e2cf1f4d 100644 --- a/agent/src/com/cloud/agent/dhcp/DhcpSnooper.java +++ b/agent/src/com/cloud/agent/dhcp/DhcpSnooper.java @@ -25,16 +25,16 @@ import com.cloud.utils.component.Adapter; public interface DhcpSnooper extends Adapter { - public InetAddress getIPAddr(String macAddr, String vmName); + public InetAddress getIPAddr(String macAddr, String vmName); - public InetAddress getDhcpServerIP(); + public InetAddress getDhcpServerIP(); - public void cleanup(String macAddr, String vmName); + public void cleanup(String macAddr, String vmName); - public Map syncIpAddr(); + public Map syncIpAddr(); - public boolean stop(); + public boolean stop(); - public void initializeMacTable(List> macVmNameList); + public void initializeMacTable(List> macVmNameList); } diff --git a/agent/src/com/cloud/agent/dhcp/DhcpSnooperImpl.java b/agent/src/com/cloud/agent/dhcp/DhcpSnooperImpl.java deleted file mode 100644 index 7195a7e6ff8..00000000000 --- a/agent/src/com/cloud/agent/dhcp/DhcpSnooperImpl.java +++ /dev/null @@ -1,324 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.agent.dhcp; - -import java.net.InetAddress; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import javax.ejb.Local; -import javax.naming.ConfigurationException; - -import org.apache.log4j.Logger; -import org.jnetpcap.Pcap; -import org.jnetpcap.PcapBpfProgram; -import org.jnetpcap.PcapIf; -import org.jnetpcap.packet.PcapPacket; -import org.jnetpcap.packet.PcapPacketHandler; -import org.jnetpcap.protocol.tcpip.Udp; - -import com.cloud.utils.Pair; -import com.cloud.utils.concurrency.NamedThreadFactory; - -@Local(value = { DhcpSnooper.class }) -public class DhcpSnooperImpl implements DhcpSnooper { - private static final Logger s_logger = Logger - .getLogger(DhcpSnooperImpl.class); - - public enum DHCPState { - DHCPACKED, DHCPREQUESTED, DHCPRESET; - } - - public class IPAddr { - String _vmName; - InetAddress _ip; - DHCPState _state; - - public IPAddr(InetAddress ip, DHCPState state, String vmName) { - _ip = ip; - _state = state; - _vmName = vmName; - } - } - - protected ExecutorService _executor; - protected Map _macIpMap; - protected Map _ipMacMap; - private DhcpServer _server; - protected long _timeout = 1200000; - protected InetAddress _dhcpServerIp; - - public DhcpSnooperImpl(String bridge, long timeout) { - - _timeout = timeout; - _executor = new ThreadPoolExecutor(10, 10 * 10, 1, TimeUnit.DAYS, - new LinkedBlockingQueue(), new NamedThreadFactory( - "DhcpListener")); - _macIpMap = new ConcurrentHashMap(); - _ipMacMap = new ConcurrentHashMap(); - _server = new DhcpServer(this, bridge); - _server.start(); - } - - @Override - public InetAddress getIPAddr(String macAddr, String vmName) { - String macAddrLowerCase = macAddr.toLowerCase(); - IPAddr addr = _macIpMap.get(macAddrLowerCase); - if (addr == null) { - addr = new IPAddr(null, DHCPState.DHCPRESET, vmName); - _macIpMap.put(macAddrLowerCase, addr); - } else { - addr._state = DHCPState.DHCPRESET; - } - - synchronized (addr) { - try { - addr.wait(_timeout); - } catch (InterruptedException e) { - } - if (addr._state == DHCPState.DHCPACKED) { - addr._state = DHCPState.DHCPRESET; - return addr._ip; - } - } - - return null; - } - - public InetAddress getDhcpServerIP() { - return _dhcpServerIp; - } - - @Override - public void cleanup(String macAddr, String vmName) { - try { - if (macAddr == null) { - return; - } - _macIpMap.remove(macAddr); - _ipMacMap.values().remove(macAddr); - } catch (Exception e) { - s_logger.debug("Failed to cleanup: " + e.toString()); - } - } - - @Override - public Map syncIpAddr() { - Collection ips = _macIpMap.values(); - HashMap vmIpMap = new HashMap(); - for (IPAddr ip : ips) { - if (ip._state == DHCPState.DHCPACKED) { - vmIpMap.put(ip._vmName, ip._ip); - } - } - return vmIpMap; - } - - @Override - public void initializeMacTable(List> macVmNameList) { - for (Pair macVmname : macVmNameList) { - IPAddr ipAdrr = new IPAddr(null, DHCPState.DHCPRESET, - macVmname.second()); - _macIpMap.put(macVmname.first(), ipAdrr); - } - } - - protected void setIPAddr(String macAddr, InetAddress ip, DHCPState state, - InetAddress dhcpServerIp) { - String macAddrLowerCase = macAddr.toLowerCase(); - if (state == DHCPState.DHCPREQUESTED) { - IPAddr ipAddr = _macIpMap.get(macAddrLowerCase); - if (ipAddr == null) { - return; - } - - _ipMacMap.put(ip, macAddr); - } else if (state == DHCPState.DHCPACKED) { - _dhcpServerIp = dhcpServerIp; - String destMac = macAddrLowerCase; - if (macAddrLowerCase.equalsIgnoreCase("ff:ff:ff:ff:ff:ff")) { - destMac = _ipMacMap.get(ip); - if (destMac == null) { - return; - } - } - - IPAddr addr = _macIpMap.get(destMac); - if (addr != null) { - addr._ip = ip; - addr._state = state; - synchronized (addr) { - addr.notify(); - } - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cloud.agent.dhcp.DhcpSnooper#stop() - */ - @Override - public boolean stop() { - _executor.shutdown(); - _server.StopServer(); - return true; - } - - private class DhcpServer extends Thread { - private DhcpSnooperImpl _manager; - private String _bridge; - private Pcap _pcapedDev; - private boolean _loop; - - public DhcpServer(DhcpSnooperImpl mgt, String bridge) { - _manager = mgt; - _bridge = bridge; - _loop = true; - } - - public void StopServer() { - _loop = false; - _pcapedDev.breakloop(); - _pcapedDev.close(); - } - - private Pcap initializePcap() { - try { - List alldevs = new ArrayList(); - StringBuilder errBuf = new StringBuilder(); - int r = Pcap.findAllDevs(alldevs, errBuf); - if (r == Pcap.NOT_OK || alldevs.isEmpty()) { - return null; - } - - PcapIf dev = null; - for (PcapIf device : alldevs) { - if (device.getName().equalsIgnoreCase(_bridge)) { - dev = device; - break; - } - } - - if (dev == null) { - s_logger.debug("Pcap: Can't find device: " + _bridge - + " to listen on"); - return null; - } - - int snaplen = 64 * 1024; - int flags = Pcap.MODE_PROMISCUOUS; - int timeout = 10 * 1000; - Pcap pcap = Pcap.openLive(dev.getName(), snaplen, flags, - timeout, errBuf); - if (pcap == null) { - s_logger.debug("Pcap: Can't open " + _bridge); - return null; - } - - PcapBpfProgram program = new PcapBpfProgram(); - String expr = "dst port 68 or 67"; - int optimize = 0; - int netmask = 0xFFFFFF00; - if (pcap.compile(program, expr, optimize, netmask) != Pcap.OK) { - s_logger.debug("Pcap: can't compile BPF"); - return null; - } - - if (pcap.setFilter(program) != Pcap.OK) { - s_logger.debug("Pcap: Can't set filter"); - return null; - } - return pcap; - } catch (Exception e) { - s_logger.debug("Failed to initialized: " + e.toString()); - } - return null; - } - - public void run() { - while (_loop) { - try { - _pcapedDev = initializePcap(); - if (_pcapedDev == null) { - return; - } - - PcapPacketHandler jpacketHandler = new PcapPacketHandler() { - public void nextPacket(PcapPacket packet, String user) { - Udp u = new Udp(); - if (packet.hasHeader(u)) { - int offset = u.getOffset() + u.getLength(); - _executor.execute(new DhcpPacketParser(packet, - offset, u.length() - u.getLength(), - _manager)); - } - } - }; - s_logger.debug("Starting DHCP snooping on " + _bridge); - int retValue = _pcapedDev.loop(-1, jpacketHandler, - "pcapPacketHandler"); - if (retValue == -1) { - s_logger.debug("Pcap: failed to set loop handler"); - } else if (retValue == -2 && !_loop) { - s_logger.debug("Pcap: terminated"); - return; - } - _pcapedDev.close(); - } catch (Exception e) { - s_logger.debug("Pcap error:" + e.toString()); - } - } - } - } - - static public void main(String args[]) { - s_logger.addAppender(new org.apache.log4j.ConsoleAppender( - new org.apache.log4j.PatternLayout(), "System.out")); - final DhcpSnooperImpl manager = new DhcpSnooperImpl("cloudbr0", 10000); - s_logger.debug(manager.getIPAddr("02:00:4c:66:00:03", "i-2-5-VM")); - manager.stop(); - - } - - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - // TODO configure timeout here - return true; - } - - @Override - public boolean start() { - return true; - } - - @Override - public String getName() { - return "DhcpSnooperImpl"; - } - -} diff --git a/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java b/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java index 27c08f3e77a..11ea824902b 100644 --- a/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java +++ b/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java @@ -39,104 +39,104 @@ import com.cloud.utils.net.NetUtils; @Local(value = { DhcpSnooper.class }) public class FakeDhcpSnooper implements DhcpSnooper { - private static final Logger s_logger = Logger - .getLogger(FakeDhcpSnooper.class); - private Queue _ipAddresses = new ConcurrentLinkedQueue(); - private Map _macIpMap = new ConcurrentHashMap(); - private Map _vmIpMap = new ConcurrentHashMap(); + private static final Logger s_logger = Logger + .getLogger(FakeDhcpSnooper.class); + private Queue _ipAddresses = new ConcurrentLinkedQueue(); + private Map _macIpMap = new ConcurrentHashMap(); + private Map _vmIpMap = new ConcurrentHashMap(); - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - String guestIpRange = (String) params.get("guest.ip.range"); - if (guestIpRange != null) { - String[] guestIps = guestIpRange.split("-"); - if (guestIps.length == 2) { - long start = NetUtils.ip2Long(guestIps[0]); - long end = NetUtils.ip2Long(guestIps[1]); - while (start <= end) { - _ipAddresses.offer(NetUtils.long2Ip(start++)); - } - } - } - return true; - } + @Override + public boolean configure(String name, Map params) + throws ConfigurationException { + String guestIpRange = (String) params.get("guest.ip.range"); + if (guestIpRange != null) { + String[] guestIps = guestIpRange.split("-"); + if (guestIps.length == 2) { + long start = NetUtils.ip2Long(guestIps[0]); + long end = NetUtils.ip2Long(guestIps[1]); + while (start <= end) { + _ipAddresses.offer(NetUtils.long2Ip(start++)); + } + } + } + return true; + } - @Override - public boolean start() { - return true; - } + @Override + public boolean start() { + return true; + } - @Override - public String getName() { - return "FakeDhcpSnooper"; - } + @Override + public String getName() { + return "FakeDhcpSnooper"; + } - @Override - public InetAddress getIPAddr(String macAddr, String vmName) { - String ipAddr = _ipAddresses.poll(); - if (ipAddr == null) { - s_logger.warn("No ip addresses left in queue"); - return null; - } - try { - InetAddress inetAddr = InetAddress.getByName(ipAddr); - _macIpMap.put(macAddr.toLowerCase(), ipAddr); - _vmIpMap.put(vmName, inetAddr); - s_logger.info("Got ip address " + ipAddr + " for vm " + vmName - + " mac=" + macAddr.toLowerCase()); - return inetAddr; - } catch (UnknownHostException e) { - s_logger.warn("Failed to get InetAddress for " + ipAddr); - return null; - } - } + @Override + public InetAddress getIPAddr(String macAddr, String vmName) { + String ipAddr = _ipAddresses.poll(); + if (ipAddr == null) { + s_logger.warn("No ip addresses left in queue"); + return null; + } + try { + InetAddress inetAddr = InetAddress.getByName(ipAddr); + _macIpMap.put(macAddr.toLowerCase(), ipAddr); + _vmIpMap.put(vmName, inetAddr); + s_logger.info("Got ip address " + ipAddr + " for vm " + vmName + + " mac=" + macAddr.toLowerCase()); + return inetAddr; + } catch (UnknownHostException e) { + s_logger.warn("Failed to get InetAddress for " + ipAddr); + return null; + } + } - @Override - public void cleanup(String macAddr, String vmName) { - try { - if (macAddr == null) { - return; - } - InetAddress inetAddr = _vmIpMap.remove(vmName); - String ipAddr = inetAddr.getHostName(); - for (Map.Entry entry : _macIpMap.entrySet()) { - if (entry.getValue().equalsIgnoreCase(ipAddr)) { - macAddr = entry.getKey(); - break; - } - } - ipAddr = _macIpMap.remove(macAddr); + @Override + public void cleanup(String macAddr, String vmName) { + try { + if (macAddr == null) { + return; + } + InetAddress inetAddr = _vmIpMap.remove(vmName); + String ipAddr = inetAddr.getHostName(); + for (Map.Entry entry : _macIpMap.entrySet()) { + if (entry.getValue().equalsIgnoreCase(ipAddr)) { + macAddr = entry.getKey(); + break; + } + } + ipAddr = _macIpMap.remove(macAddr); - s_logger.info("Cleaning up for mac address: " + macAddr + " ip=" - + ipAddr + " inetAddr=" + inetAddr); - if (ipAddr != null) { - _ipAddresses.offer(ipAddr); - } - } catch (Exception e) { - s_logger.debug("Failed to cleanup: " + e.toString()); - } - } + s_logger.info("Cleaning up for mac address: " + macAddr + " ip=" + + ipAddr + " inetAddr=" + inetAddr); + if (ipAddr != null) { + _ipAddresses.offer(ipAddr); + } + } catch (Exception e) { + s_logger.debug("Failed to cleanup: " + e.toString()); + } + } - @Override - public Map syncIpAddr() { - return _vmIpMap; - } + @Override + public Map syncIpAddr() { + return _vmIpMap; + } - @Override - public boolean stop() { - return false; - } + @Override + public boolean stop() { + return false; + } - @Override - public void initializeMacTable(List> macVmNameList) { + @Override + public void initializeMacTable(List> macVmNameList) { - } + } - @Override - public InetAddress getDhcpServerIP() { - // TODO Auto-generated method stub - return null; - } + @Override + public InetAddress getDhcpServerIP() { + // TODO Auto-generated method stub + return null; + } } diff --git a/agent/src/com/cloud/agent/mockvm/MockVm.java b/agent/src/com/cloud/agent/mockvm/MockVm.java index 1589a8f60e2..306a6c40786 100644 --- a/agent/src/com/cloud/agent/mockvm/MockVm.java +++ b/agent/src/com/cloud/agent/mockvm/MockVm.java @@ -21,61 +21,61 @@ import com.cloud.vm.VirtualMachine.State; // As storage is mapped from storage device, can virtually treat that VM here does public class MockVm { - private String vmName; - private State state = State.Stopped; + private String vmName; + private State state = State.Stopped; - private long ramSize; // unit of Mbytes - private int cpuCount; - private int utilization; // in percentage - private int vncPort; // 0-based allocation, real port number needs to be - // applied with base + private long ramSize; // unit of Mbytes + private int cpuCount; + private int utilization; // in percentage + private int vncPort; // 0-based allocation, real port number needs to be + // applied with base - public MockVm() { - } + public MockVm() { + } - public MockVm(String vmName, State state, long ramSize, int cpuCount, - int utilization, int vncPort) { - this.vmName = vmName; - this.state = state; - this.ramSize = ramSize; - this.cpuCount = cpuCount; - this.utilization = utilization; - this.vncPort = vncPort; - } + public MockVm(String vmName, State state, long ramSize, int cpuCount, + int utilization, int vncPort) { + this.vmName = vmName; + this.state = state; + this.ramSize = ramSize; + this.cpuCount = cpuCount; + this.utilization = utilization; + this.vncPort = vncPort; + } - public String getName() { - return vmName; - } + public String getName() { + return vmName; + } - public State getState() { - return state; - } + public State getState() { + return state; + } - public void setState(State state) { - this.state = state; - } + public void setState(State state) { + this.state = state; + } - public long getRamSize() { - return ramSize; - } + public long getRamSize() { + return ramSize; + } - public int getCpuCount() { - return cpuCount; - } + public int getCpuCount() { + return cpuCount; + } - public int getUtilization() { - return utilization; - } + public int getUtilization() { + return utilization; + } - public int getVncPort() { - return vncPort; - } + public int getVncPort() { + return vncPort; + } - public static void main(String[] args) { - long i = 10; - Long l = null; - if (i == l) { - System.out.print("fdfd"); - } - } + public static void main(String[] args) { + long i = 10; + Long l = null; + if (i == l) { + System.out.print("fdfd"); + } + } } diff --git a/agent/src/com/cloud/agent/mockvm/MockVmMgr.java b/agent/src/com/cloud/agent/mockvm/MockVmMgr.java index 68713ab3e6c..c89a1352aa2 100644 --- a/agent/src/com/cloud/agent/mockvm/MockVmMgr.java +++ b/agent/src/com/cloud/agent/mockvm/MockVmMgr.java @@ -29,295 +29,295 @@ import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.vm.VirtualMachine.State; public class MockVmMgr implements VmMgr { - private static final Logger s_logger = Logger.getLogger(MockVmMgr.class); + private static final Logger s_logger = Logger.getLogger(MockVmMgr.class); - private static final int DEFAULT_DOM0_MEM_MB = 128; - private static final Random randSeed = new Random(); + private static final int DEFAULT_DOM0_MEM_MB = 128; + private static final Random randSeed = new Random(); - private final Map vms = new HashMap(); - private long vncPortMap = 0; + private final Map vms = new HashMap(); + private long vncPortMap = 0; - private Map _params = null; + private Map _params = null; - public MockVmMgr() { - } + public MockVmMgr() { + } - @Override - public Set getCurrentVMs() { - HashSet vmNameSet = new HashSet(); - synchronized (this) { - for (String vmName : vms.keySet()) - vmNameSet.add(vmName); - } - return vmNameSet; - } + @Override + public Set getCurrentVMs() { + HashSet vmNameSet = new HashSet(); + synchronized (this) { + for (String vmName : vms.keySet()) + vmNameSet.add(vmName); + } + return vmNameSet; + } - @Override - public String startVM(String vmName, String vnetId, String gateway, - String dns, String privateIP, String privateMac, - String privateMask, String publicIP, String publicMac, - String publicMask, int cpuCount, int cpuUtilization, long ramSize, - String localPath, String vncPassword) { + @Override + public String startVM(String vmName, String vnetId, String gateway, + String dns, String privateIP, String privateMac, + String privateMask, String publicIP, String publicMac, + String publicMask, int cpuCount, int cpuUtilization, long ramSize, + String localPath, String vncPassword) { - if (s_logger.isInfoEnabled()) { - StringBuffer sb = new StringBuffer(); - sb.append("Start VM. name: " + vmName + ", vnet: " + vnetId - + ", dns: " + dns); - sb.append(", privateIP: " + privateIP + ", privateMac: " - + privateMac + ", privateMask: " + privateMask); - sb.append(", publicIP: " + publicIP + ", publicMac: " + publicMac - + ", publicMask: " + publicMask); - sb.append(", cpu count: " + cpuCount + ", cpuUtilization: " - + cpuUtilization + ", ram : " + ramSize); - sb.append(", localPath: " + localPath); - s_logger.info(sb.toString()); - } + if (s_logger.isInfoEnabled()) { + StringBuffer sb = new StringBuffer(); + sb.append("Start VM. name: " + vmName + ", vnet: " + vnetId + + ", dns: " + dns); + sb.append(", privateIP: " + privateIP + ", privateMac: " + + privateMac + ", privateMask: " + privateMask); + sb.append(", publicIP: " + publicIP + ", publicMac: " + publicMac + + ", publicMask: " + publicMask); + sb.append(", cpu count: " + cpuCount + ", cpuUtilization: " + + cpuUtilization + ", ram : " + ramSize); + sb.append(", localPath: " + localPath); + s_logger.info(sb.toString()); + } - synchronized (this) { - MockVm vm = vms.get(vmName); - if (vm == null) { - if (ramSize > getHostFreeMemory()) - return "Out of memory"; + synchronized (this) { + MockVm vm = vms.get(vmName); + if (vm == null) { + if (ramSize > getHostFreeMemory()) + return "Out of memory"; - int vncPort = allocVncPort(); - if (vncPort < 0) - return "Unable to allocate VNC port"; + int vncPort = allocVncPort(); + if (vncPort < 0) + return "Unable to allocate VNC port"; - vm = new MockVm(vmName, State.Running, ramSize, cpuCount, - cpuUtilization, vncPort); - vms.put(vmName, vm); - } - } + vm = new MockVm(vmName, State.Running, ramSize, cpuCount, + cpuUtilization, vncPort); + vms.put(vmName, vm); + } + } - return null; - } + return null; + } - @Override - public String stopVM(String vmName, boolean force) { - if (s_logger.isInfoEnabled()) - s_logger.info("Stop VM. name: " + vmName); + @Override + public String stopVM(String vmName, boolean force) { + if (s_logger.isInfoEnabled()) + s_logger.info("Stop VM. name: " + vmName); - synchronized (this) { - MockVm vm = vms.get(vmName); - if (vm != null) { - vm.setState(State.Stopped); - freeVncPort(vm.getVncPort()); - } - } + synchronized (this) { + MockVm vm = vms.get(vmName); + if (vm != null) { + vm.setState(State.Stopped); + freeVncPort(vm.getVncPort()); + } + } - return null; - } + return null; + } - @Override - public String rebootVM(String vmName) { - if (s_logger.isInfoEnabled()) - s_logger.info("Reboot VM. name: " + vmName); + @Override + public String rebootVM(String vmName) { + if (s_logger.isInfoEnabled()) + s_logger.info("Reboot VM. name: " + vmName); - synchronized (this) { - MockVm vm = vms.get(vmName); - if (vm != null) - vm.setState(State.Running); - } - return null; - } + synchronized (this) { + MockVm vm = vms.get(vmName); + if (vm != null) + vm.setState(State.Running); + } + return null; + } - @Override - public boolean migrate(String vmName, String params) { - if (s_logger.isInfoEnabled()) - s_logger.info("Migrate VM. name: " + vmName); + @Override + public boolean migrate(String vmName, String params) { + if (s_logger.isInfoEnabled()) + s_logger.info("Migrate VM. name: " + vmName); - synchronized (this) { - MockVm vm = vms.get(vmName); - if (vm != null) { - vm.setState(State.Stopped); - freeVncPort(vm.getVncPort()); + synchronized (this) { + MockVm vm = vms.get(vmName); + if (vm != null) { + vm.setState(State.Stopped); + freeVncPort(vm.getVncPort()); - vms.remove(vmName); - return true; - } - } + vms.remove(vmName); + return true; + } + } - return false; - } + return false; + } - public MockVm getVm(String vmName) { - synchronized (this) { - MockVm vm = vms.get(vmName); - return vm; - } - } + public MockVm getVm(String vmName) { + synchronized (this) { + MockVm vm = vms.get(vmName); + return vm; + } + } - @Override - public State checkVmState(String vmName) { + @Override + public State checkVmState(String vmName) { - synchronized (this) { - MockVm vm = vms.get(vmName); - if (vm != null) - return vm.getState(); - } - return State.Unknown; - } + synchronized (this) { + MockVm vm = vms.get(vmName); + if (vm != null) + return vm.getState(); + } + return State.Unknown; + } - @Override - public Map getVmStates() { - Map states = new HashMap(); + @Override + public Map getVmStates() { + Map states = new HashMap(); - synchronized (this) { - for (MockVm vm : vms.values()) { - states.put(vm.getName(), vm.getState()); - } - } - return states; - } + synchronized (this) { + for (MockVm vm : vms.values()) { + states.put(vm.getName(), vm.getState()); + } + } + return states; + } - @Override - public void cleanupVM(String vmName, String local, String vnet) { - synchronized (this) { - MockVm vm = vms.get(vmName); - if (vm != null) { - freeVncPort(vm.getVncPort()); - } - vms.remove(vmName); - } - } + @Override + public void cleanupVM(String vmName, String local, String vnet) { + synchronized (this) { + MockVm vm = vms.get(vmName); + if (vm != null) { + freeVncPort(vm.getVncPort()); + } + vms.remove(vmName); + } + } - @Override - public double getHostCpuUtilization() { - return 0.0d; - } + @Override + public double getHostCpuUtilization() { + return 0.0d; + } - @Override - public int getHostCpuCount() { + @Override + public int getHostCpuCount() { - return getConfiguredProperty("cpus", 4); - } + return getConfiguredProperty("cpus", 4); + } - @Override - public long getHostCpuSpeed() { - return getConfiguredProperty("cpuspeed", 4000L); + @Override + public long getHostCpuSpeed() { + return getConfiguredProperty("cpuspeed", 4000L); - } + } - @Override - public long getHostTotalMemory() { // total memory in bytes - return getConfiguredProperty("memory", 16000L); + @Override + public long getHostTotalMemory() { // total memory in bytes + return getConfiguredProperty("memory", 16000L); - } + } - @Override - public long getHostFreeMemory() { // free memory in bytes - long memSize = getHostTotalMemory(); - memSize -= getHostDom0Memory(); + @Override + public long getHostFreeMemory() { // free memory in bytes + long memSize = getHostTotalMemory(); + memSize -= getHostDom0Memory(); - synchronized (this) { - for (MockVm vm : vms.values()) { - if (vm.getState() != State.Stopped) - memSize -= vm.getRamSize(); - } - } + synchronized (this) { + for (MockVm vm : vms.values()) { + if (vm.getState() != State.Stopped) + memSize -= vm.getRamSize(); + } + } - return memSize; - } + return memSize; + } - @Override - public long getHostDom0Memory() { // memory size in bytes - return DEFAULT_DOM0_MEM_MB * 1024 * 1024L; - } + @Override + public long getHostDom0Memory() { // memory size in bytes + return DEFAULT_DOM0_MEM_MB * 1024 * 1024L; + } - @Override - public String cleanupVnet(String vnetId) { - return null; - } + @Override + public String cleanupVnet(String vnetId) { + return null; + } - @Override - public Integer getVncPort(String name) { - synchronized (this) { - MockVm vm = vms.get(name); - if (vm != null) - return vm.getVncPort(); - } + @Override + public Integer getVncPort(String name) { + synchronized (this) { + MockVm vm = vms.get(name); + if (vm != null) + return vm.getVncPort(); + } - return new Integer(-1); - } + return new Integer(-1); + } - public int allocVncPort() { - for (int i = 0; i < 64; i++) { - if (((1L << i) & vncPortMap) == 0) { - vncPortMap |= (1L << i); - return i; - } - } - return -1; - } + public int allocVncPort() { + for (int i = 0; i < 64; i++) { + if (((1L << i) & vncPortMap) == 0) { + vncPortMap |= (1L << i); + return i; + } + } + return -1; + } - public void freeVncPort(int port) { - vncPortMap &= ~(1L << port); - } + public void freeVncPort(int port) { + vncPortMap &= ~(1L << port); + } - @Override - public MockVm createVmFromSpec(VirtualMachineTO vmSpec) { - String vmName = vmSpec.getName(); - long ramSize = vmSpec.getMinRam(); - int utilizationPercent = randSeed.nextInt() % 100; - MockVm vm = null; + @Override + public MockVm createVmFromSpec(VirtualMachineTO vmSpec) { + String vmName = vmSpec.getName(); + long ramSize = vmSpec.getMinRam(); + int utilizationPercent = randSeed.nextInt() % 100; + MockVm vm = null; - synchronized (this) { - vm = vms.get(vmName); - if (vm == null) { - if (ramSize > getHostFreeMemory()) { - s_logger.debug("host is out of memory"); - throw new CloudRuntimeException("Host is out of Memory"); - } + synchronized (this) { + vm = vms.get(vmName); + if (vm == null) { + if (ramSize > getHostFreeMemory()) { + s_logger.debug("host is out of memory"); + throw new CloudRuntimeException("Host is out of Memory"); + } - int vncPort = allocVncPort(); - if (vncPort < 0) { - s_logger.debug("Unable to allocate VNC port"); - throw new CloudRuntimeException( - "Unable to allocate vnc port"); - } + int vncPort = allocVncPort(); + if (vncPort < 0) { + s_logger.debug("Unable to allocate VNC port"); + throw new CloudRuntimeException( + "Unable to allocate vnc port"); + } - vm = new MockVm(vmName, State.Running, ramSize, - vmSpec.getCpus(), utilizationPercent, vncPort); - vms.put(vmName, vm); - } - } - return vm; - } + vm = new MockVm(vmName, State.Running, ramSize, + vmSpec.getCpus(), utilizationPercent, vncPort); + vms.put(vmName, vm); + } + } + return vm; + } - @Override - public void createVbd(VirtualMachineTO vmSpec, String vmName, MockVm vm) { - // TODO Auto-generated method stub + @Override + public void createVbd(VirtualMachineTO vmSpec, String vmName, MockVm vm) { + // TODO Auto-generated method stub - } + } - @Override - public void createVif(VirtualMachineTO vmSpec, String vmName, MockVm vm) { - // TODO Auto-generated method stub + @Override + public void createVif(VirtualMachineTO vmSpec, String vmName, MockVm vm) { + // TODO Auto-generated method stub - } + } - @Override - public void configure(Map params) { - _params = params; - } + @Override + public void configure(Map params) { + _params = params; + } - protected Long getConfiguredProperty(String key, Long defaultValue) { - String val = (String) _params.get(key); + protected Long getConfiguredProperty(String key, Long defaultValue) { + String val = (String) _params.get(key); - if (val != null) { - Long result = Long.parseLong(val); - return result; - } - return defaultValue; - } + if (val != null) { + Long result = Long.parseLong(val); + return result; + } + return defaultValue; + } - protected Integer getConfiguredProperty(String key, Integer defaultValue) { - String val = (String) _params.get(key); + protected Integer getConfiguredProperty(String key, Integer defaultValue) { + String val = (String) _params.get(key); - if (val != null) { - Integer result = Integer.parseInt(val); - return result; - } - return defaultValue; - } + if (val != null) { + Integer result = Integer.parseInt(val); + return result; + } + return defaultValue; + } } diff --git a/agent/src/com/cloud/agent/mockvm/VmMgr.java b/agent/src/com/cloud/agent/mockvm/VmMgr.java index 55e59909259..1a7050c2376 100644 --- a/agent/src/com/cloud/agent/mockvm/VmMgr.java +++ b/agent/src/com/cloud/agent/mockvm/VmMgr.java @@ -23,49 +23,49 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.vm.VirtualMachine.State; public interface VmMgr { - public Set getCurrentVMs(); + public Set getCurrentVMs(); - public String startVM(String vmName, String vnetId, String gateway, - String dns, String privateIP, String privateMac, - String privateMask, String publicIP, String publicMac, - String publicMask, int cpuCount, int cpuUtilization, long ramSize, - String localPath, String vncPassword); + public String startVM(String vmName, String vnetId, String gateway, + String dns, String privateIP, String privateMac, + String privateMask, String publicIP, String publicMac, + String publicMask, int cpuCount, int cpuUtilization, long ramSize, + String localPath, String vncPassword); - public String stopVM(String vmName, boolean force); + public String stopVM(String vmName, boolean force); - public String rebootVM(String vmName); + public String rebootVM(String vmName); - public void cleanupVM(String vmName, String local, String vnet); + public void cleanupVM(String vmName, String local, String vnet); - public boolean migrate(String vmName, String params); + public boolean migrate(String vmName, String params); - public MockVm getVm(String vmName); + public MockVm getVm(String vmName); - public State checkVmState(String vmName); + public State checkVmState(String vmName); - public Map getVmStates(); + public Map getVmStates(); - public Integer getVncPort(String name); + public Integer getVncPort(String name); - public String cleanupVnet(String vnetId); + public String cleanupVnet(String vnetId); - public double getHostCpuUtilization(); + public double getHostCpuUtilization(); - public int getHostCpuCount(); + public int getHostCpuCount(); - public long getHostCpuSpeed(); + public long getHostCpuSpeed(); - public long getHostTotalMemory(); + public long getHostTotalMemory(); - public long getHostFreeMemory(); + public long getHostFreeMemory(); - public long getHostDom0Memory(); + public long getHostDom0Memory(); - public MockVm createVmFromSpec(VirtualMachineTO vmSpec); + public MockVm createVmFromSpec(VirtualMachineTO vmSpec); - public void createVbd(VirtualMachineTO vmSpec, String vmName, MockVm vm); + public void createVbd(VirtualMachineTO vmSpec, String vmName, MockVm vm); - public void createVif(VirtualMachineTO vmSpec, String vmName, MockVm vm); + public void createVif(VirtualMachineTO vmSpec, String vmName, MockVm vm); - public void configure(Map params); + public void configure(Map params); } diff --git a/agent/src/com/cloud/agent/resource/DummyResource.java b/agent/src/com/cloud/agent/resource/DummyResource.java index 26256d2db3b..573f639b06d 100755 --- a/agent/src/com/cloud/agent/resource/DummyResource.java +++ b/agent/src/com/cloud/agent/resource/DummyResource.java @@ -45,183 +45,183 @@ import com.cloud.storage.Storage.StoragePoolType; @Local(value = { ServerResource.class }) public class DummyResource implements ServerResource { - String _name; - Host.Type _type; - boolean _negative; - IAgentControl _agentControl; - private Map _params; + String _name; + Host.Type _type; + boolean _negative; + IAgentControl _agentControl; + private Map _params; - @Override - public void disconnected() { - } + @Override + public void disconnected() { + } - @Override - public Answer executeRequest(Command cmd) { - if (cmd instanceof CheckNetworkCommand) { - return new CheckNetworkAnswer((CheckNetworkCommand) cmd, true, null); - } - System.out.println("Received Command: " + cmd.toString()); - Answer answer = new Answer(cmd, !_negative, "response"); - System.out.println("Replying with: " + answer.toString()); - return answer; - } + @Override + public Answer executeRequest(Command cmd) { + if (cmd instanceof CheckNetworkCommand) { + return new CheckNetworkAnswer((CheckNetworkCommand) cmd, true, null); + } + System.out.println("Received Command: " + cmd.toString()); + Answer answer = new Answer(cmd, !_negative, "response"); + System.out.println("Replying with: " + answer.toString()); + return answer; + } - @Override - public PingCommand getCurrentStatus(long id) { - return new PingCommand(_type, id); - } + @Override + public PingCommand getCurrentStatus(long id) { + return new PingCommand(_type, id); + } - @Override - public Type getType() { - return _type; - } + @Override + public Type getType() { + return _type; + } - protected String getConfiguredProperty(String key, String defaultValue) { - String val = (String) _params.get(key); - return val == null ? defaultValue : val; - } + protected String getConfiguredProperty(String key, String defaultValue) { + String val = (String) _params.get(key); + return val == null ? defaultValue : val; + } - protected Long getConfiguredProperty(String key, Long defaultValue) { - String val = (String) _params.get(key); + protected Long getConfiguredProperty(String key, Long defaultValue) { + String val = (String) _params.get(key); - if (val != null) { - Long result = Long.parseLong(val); - return result; - } - return defaultValue; - } + if (val != null) { + Long result = Long.parseLong(val); + return result; + } + return defaultValue; + } - protected List getHostInfo() { - final ArrayList info = new ArrayList(); - long speed = getConfiguredProperty("cpuspeed", 4000L); - long cpus = getConfiguredProperty("cpus", 4L); - long ram = getConfiguredProperty("memory", 16000L * 1024L * 1024L); - long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L); + protected List getHostInfo() { + final ArrayList info = new ArrayList(); + long speed = getConfiguredProperty("cpuspeed", 4000L); + long cpus = getConfiguredProperty("cpus", 4L); + long ram = getConfiguredProperty("memory", 16000L * 1024L * 1024L); + long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L); - String cap = getConfiguredProperty("capabilities", "hvm"); - info.add((int) cpus); - info.add(speed); - info.add(ram); - info.add(cap); - info.add(dom0ram); - return info; + String cap = getConfiguredProperty("capabilities", "hvm"); + info.add((int) cpus); + info.add(speed); + info.add(ram); + info.add(cap); + info.add(dom0ram); + return info; - } + } - protected void fillNetworkInformation(final StartupCommand cmd) { + protected void fillNetworkInformation(final StartupCommand cmd) { - cmd.setPrivateIpAddress((String) getConfiguredProperty( - "private.ip.address", "127.0.0.1")); - cmd.setPrivateMacAddress((String) getConfiguredProperty( - "private.mac.address", "8A:D2:54:3F:7C:C3")); - cmd.setPrivateNetmask((String) getConfiguredProperty( - "private.ip.netmask", "255.255.255.0")); + cmd.setPrivateIpAddress((String) getConfiguredProperty( + "private.ip.address", "127.0.0.1")); + cmd.setPrivateMacAddress((String) getConfiguredProperty( + "private.mac.address", "8A:D2:54:3F:7C:C3")); + cmd.setPrivateNetmask((String) getConfiguredProperty( + "private.ip.netmask", "255.255.255.0")); - cmd.setStorageIpAddress((String) getConfiguredProperty( - "private.ip.address", "127.0.0.1")); - cmd.setStorageMacAddress((String) getConfiguredProperty( - "private.mac.address", "8A:D2:54:3F:7C:C3")); - cmd.setStorageNetmask((String) getConfiguredProperty( - "private.ip.netmask", "255.255.255.0")); - cmd.setGatewayIpAddress((String) getConfiguredProperty( - "gateway.ip.address", "127.0.0.1")); + cmd.setStorageIpAddress((String) getConfiguredProperty( + "private.ip.address", "127.0.0.1")); + cmd.setStorageMacAddress((String) getConfiguredProperty( + "private.mac.address", "8A:D2:54:3F:7C:C3")); + cmd.setStorageNetmask((String) getConfiguredProperty( + "private.ip.netmask", "255.255.255.0")); + cmd.setGatewayIpAddress((String) getConfiguredProperty( + "gateway.ip.address", "127.0.0.1")); - } + } - private Map getVersionStrings() { - Map result = new HashMap(); - String hostOs = (String) _params.get("Host.OS"); - String hostOsVer = (String) _params.get("Host.OS.Version"); - String hostOsKernVer = (String) _params.get("Host.OS.Kernel.Version"); - result.put("Host.OS", hostOs == null ? "Fedora" : hostOs); - result.put("Host.OS.Version", hostOsVer == null ? "14" : hostOsVer); - result.put("Host.OS.Kernel.Version", - hostOsKernVer == null ? "2.6.35.6-45.fc14.x86_64" - : hostOsKernVer); - return result; - } + private Map getVersionStrings() { + Map result = new HashMap(); + String hostOs = (String) _params.get("Host.OS"); + String hostOsVer = (String) _params.get("Host.OS.Version"); + String hostOsKernVer = (String) _params.get("Host.OS.Kernel.Version"); + result.put("Host.OS", hostOs == null ? "Fedora" : hostOs); + result.put("Host.OS.Version", hostOsVer == null ? "14" : hostOsVer); + result.put("Host.OS.Kernel.Version", + hostOsKernVer == null ? "2.6.35.6-45.fc14.x86_64" + : hostOsKernVer); + return result; + } - protected StoragePoolInfo initializeLocalStorage() { - String hostIp = (String) getConfiguredProperty("private.ip.address", - "127.0.0.1"); - String localStoragePath = (String) getConfiguredProperty( - "local.storage.path", "/mnt"); - String lh = hostIp + localStoragePath; - String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString(); + protected StoragePoolInfo initializeLocalStorage() { + String hostIp = (String) getConfiguredProperty("private.ip.address", + "127.0.0.1"); + String localStoragePath = (String) getConfiguredProperty( + "local.storage.path", "/mnt"); + String lh = hostIp + localStoragePath; + String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString(); - String capacity = (String) getConfiguredProperty( - "local.storage.capacity", "1000000000"); - String available = (String) getConfiguredProperty( - "local.storage.avail", "10000000"); + String capacity = (String) getConfiguredProperty( + "local.storage.capacity", "1000000000"); + String available = (String) getConfiguredProperty( + "local.storage.avail", "10000000"); - return new StoragePoolInfo(uuid, hostIp, localStoragePath, - localStoragePath, StoragePoolType.Filesystem, - Long.parseLong(capacity), Long.parseLong(available)); + return new StoragePoolInfo(uuid, hostIp, localStoragePath, + localStoragePath, StoragePoolType.Filesystem, + Long.parseLong(capacity), Long.parseLong(available)); - } + } - @Override - public StartupCommand[] initialize() { - Map changes = null; + @Override + public StartupCommand[] initialize() { + Map changes = null; - final List info = getHostInfo(); + final List info = getHostInfo(); - final StartupRoutingCommand cmd = new StartupRoutingCommand( - (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), - (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, - RouterPrivateIpStrategy.HostLocal, changes); - fillNetworkInformation(cmd); - cmd.getHostDetails().putAll(getVersionStrings()); - cmd.setCluster(getConfiguredProperty("cluster", "1")); - StoragePoolInfo pi = initializeLocalStorage(); - StartupStorageCommand sscmd = new StartupStorageCommand(); - sscmd.setPoolInfo(pi); - sscmd.setGuid(pi.getUuid()); - sscmd.setDataCenter((String) _params.get("zone")); - sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); + final StartupRoutingCommand cmd = new StartupRoutingCommand( + (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), + (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, + RouterPrivateIpStrategy.HostLocal, changes); + fillNetworkInformation(cmd); + cmd.getHostDetails().putAll(getVersionStrings()); + cmd.setCluster(getConfiguredProperty("cluster", "1")); + StoragePoolInfo pi = initializeLocalStorage(); + StartupStorageCommand sscmd = new StartupStorageCommand(); + sscmd.setPoolInfo(pi); + sscmd.setGuid(pi.getUuid()); + sscmd.setDataCenter((String) _params.get("zone")); + sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); - return new StartupCommand[] { cmd, sscmd }; - } + return new StartupCommand[] { cmd, sscmd }; + } - @Override - public boolean configure(String name, Map params) { - _name = name; + @Override + public boolean configure(String name, Map params) { + _name = name; - String value = (String) params.get("type"); - _type = Host.Type.valueOf(value); + String value = (String) params.get("type"); + _type = Host.Type.valueOf(value); - value = (String) params.get("negative.reply"); - _negative = Boolean.parseBoolean(value); - setParams(params); - return true; - } + value = (String) params.get("negative.reply"); + _negative = Boolean.parseBoolean(value); + setParams(params); + return true; + } - public void setParams(Map _params) { - this._params = _params; - } + public void setParams(Map _params) { + this._params = _params; + } - @Override - public String getName() { - return _name; - } + @Override + public String getName() { + return _name; + } - @Override - public boolean start() { - return true; - } + @Override + public boolean start() { + return true; + } - @Override - public boolean stop() { - return true; - } + @Override + public boolean stop() { + return true; + } - @Override - public IAgentControl getAgentControl() { - return _agentControl; - } + @Override + public IAgentControl getAgentControl() { + return _agentControl; + } - @Override - public void setAgentControl(IAgentControl agentControl) { - _agentControl = agentControl; - } + @Override + public void setAgentControl(IAgentControl agentControl) { + _agentControl = agentControl; + } } diff --git a/agent/src/com/cloud/agent/resource/computing/CloudZonesComputingResource.java b/agent/src/com/cloud/agent/resource/computing/CloudZonesComputingResource.java deleted file mode 100644 index 37bfc508686..00000000000 --- a/agent/src/com/cloud/agent/resource/computing/CloudZonesComputingResource.java +++ /dev/null @@ -1,293 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.agent.resource.computing; - -import java.net.InetAddress; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.naming.ConfigurationException; - -import org.apache.log4j.Logger; -import org.libvirt.Connect; -import org.libvirt.Domain; -import org.libvirt.LibvirtException; - -import com.cloud.agent.api.Answer; -import com.cloud.agent.api.Command; -import com.cloud.agent.api.StartAnswer; -import com.cloud.agent.api.StartCommand; - -import com.cloud.agent.api.StopAnswer; -import com.cloud.agent.api.StopCommand; - -import com.cloud.agent.api.routing.SavePasswordCommand; -import com.cloud.agent.api.routing.VmDataCommand; -import com.cloud.agent.api.to.NicTO; -import com.cloud.agent.api.to.VirtualMachineTO; -import com.cloud.agent.dhcp.DhcpSnooper; -import com.cloud.agent.dhcp.DhcpSnooperImpl; - -import com.cloud.agent.resource.computing.LibvirtComputingResource; -import com.cloud.agent.resource.computing.LibvirtConnection; -import com.cloud.agent.resource.computing.LibvirtVMDef; -import com.cloud.agent.resource.computing.LibvirtVMDef.DiskDef; -import com.cloud.agent.resource.computing.LibvirtVMDef.InterfaceDef; -import com.cloud.agent.vmdata.JettyVmDataServer; -import com.cloud.agent.vmdata.VmDataServer; - -import com.cloud.network.Networks.TrafficType; -import com.cloud.utils.Pair; -import com.cloud.vm.VirtualMachine; -import com.cloud.vm.VirtualMachine.State; - -/** - * Logic specific to the Cloudzones feature - * - * } - **/ - -public class CloudZonesComputingResource extends LibvirtComputingResource { - private static final Logger s_logger = Logger - .getLogger(CloudZonesComputingResource.class); - protected DhcpSnooper _dhcpSnooper; - String _parent; - long _dhcpTimeout; - protected String _hostIp; - protected String _hostMacAddress; - protected VmDataServer _vmDataServer = new JettyVmDataServer(); - - private void setupDhcpManager(Connect conn, String bridgeName) { - - _dhcpSnooper = new DhcpSnooperImpl(bridgeName, _dhcpTimeout); - - List> macs = new ArrayList>(); - try { - int[] domainIds = conn.listDomains(); - for (int i = 0; i < domainIds.length; i++) { - Domain vm = conn.domainLookupByID(domainIds[i]); - if (vm.getName().startsWith("i-")) { - List nics = getInterfaces(conn, vm.getName()); - InterfaceDef nic = nics.get(0); - macs.add(new Pair(nic.getMacAddress(), vm - .getName())); - } - } - } catch (LibvirtException e) { - s_logger.debug("Failed to get MACs: " + e.toString()); - } - - _dhcpSnooper.initializeMacTable(macs); - } - - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - boolean success = super.configure(name, params); - if (!success) { - return false; - } - - _parent = (String) params.get("mount.path"); - - try { - _dhcpTimeout = Long.parseLong((String) params.get("dhcp.timeout")); - } catch (Exception e) { - _dhcpTimeout = 1200000; - } - - _hostIp = (String) params.get("host.ip"); - _hostMacAddress = (String) params.get("host.mac.address"); - - try { - Connect conn; - conn = LibvirtConnection.getConnection(); - setupDhcpManager(conn, _guestBridgeName); - } catch (LibvirtException e) { - s_logger.debug("Failed to get libvirt connection:" + e.toString()); - return false; - } - - _dhcpSnooper.configure(name, params); - _vmDataServer.configure(name, params); - - return true; - } - - @Override - protected synchronized StartAnswer execute(StartCommand cmd) { - VirtualMachineTO vmSpec = cmd.getVirtualMachine(); - String vmName = vmSpec.getName(); - LibvirtVMDef vm = null; - - State state = State.Stopped; - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - synchronized (_vms) { - _vms.put(vmName, State.Starting); - } - - vm = createVMFromSpec(vmSpec); - - createVbd(conn, vmSpec, vmName, vm); - - createVifs(conn, vmSpec, vm); - - s_logger.debug("starting " + vmName + ": " + vm.toString()); - startDomain(conn, vmName, vm.toString()); - - NicTO[] nics = vmSpec.getNics(); - for (NicTO nic : nics) { - if (nic.isSecurityGroupEnabled()) { - if (vmSpec.getType() != VirtualMachine.Type.User) { - default_network_rules_for_systemvm(conn, vmName); - } else { - nic.setIp(null); - default_network_rules(conn, vmName, nic, vmSpec.getId()); - } - } - } - - // Attach each data volume to the VM, if there is a deferred - // attached disk - for (DiskDef disk : vm.getDevices().getDisks()) { - if (disk.isAttachDeferred()) { - attachOrDetachDevice(conn, true, vmName, disk.toString()); - } - } - - if (vmSpec.getType() == VirtualMachine.Type.User) { - for (NicTO nic : nics) { - if (nic.getType() == TrafficType.Guest) { - InetAddress ipAddr = _dhcpSnooper.getIPAddr( - nic.getMac(), vmName); - if (ipAddr == null) { - s_logger.debug("Failed to get guest DHCP ip, stop it"); - StopCommand stpCmd = new StopCommand(vmName); - execute(stpCmd); - return new StartAnswer(cmd, - "Failed to get guest DHCP ip, stop it"); - } - s_logger.debug(ipAddr); - nic.setIp(ipAddr.getHostAddress()); - - post_default_network_rules(conn, vmName, nic, - vmSpec.getId(), _dhcpSnooper.getDhcpServerIP(), - _hostIp, _hostMacAddress); - _vmDataServer.handleVmStarted(cmd.getVirtualMachine()); - } - } - } - - state = State.Running; - return new StartAnswer(cmd); - } catch (Exception e) { - s_logger.warn("Exception ", e); - if (conn != null) { - handleVmStartFailure(conn, vmName, vm); - } - return new StartAnswer(cmd, e.getMessage()); - } finally { - synchronized (_vms) { - if (state != State.Stopped) { - _vms.put(vmName, state); - } else { - _vms.remove(vmName); - } - } - } - } - - protected Answer execute(StopCommand cmd) { - final String vmName = cmd.getVmName(); - - Long bytesReceived = new Long(0); - Long bytesSent = new Long(0); - - State state = null; - synchronized (_vms) { - state = _vms.get(vmName); - _vms.put(vmName, State.Stopping); - } - try { - Connect conn = LibvirtConnection.getConnection(); - - try { - Domain dm = conn.domainLookupByUUID(UUID - .nameUUIDFromBytes(vmName.getBytes())); - } catch (LibvirtException e) { - state = State.Stopped; - return new StopAnswer(cmd, null, 0, bytesSent, bytesReceived); - } - - String macAddress = null; - if (vmName.startsWith("i-")) { - List nics = getInterfaces(conn, vmName); - if (!nics.isEmpty()) { - macAddress = nics.get(0).getMacAddress(); - } - } - - destroy_network_rules_for_vm(conn, vmName); - String result = stopVM(conn, vmName, defineOps.UNDEFINE_VM); - - try { - cleanupVnet(conn, cmd.getVnet()); - _dhcpSnooper.cleanup(macAddress, vmName); - _vmDataServer.handleVmStopped(cmd.getVmName()); - } catch (Exception e) { - - } - - state = State.Stopped; - return new StopAnswer(cmd, result, 0, bytesSent, bytesReceived); - } catch (LibvirtException e) { - return new StopAnswer(cmd, e.getMessage()); - } finally { - synchronized (_vms) { - if (state != null) { - _vms.put(vmName, state); - } else { - _vms.remove(vmName); - } - } - } - } - - @Override - public Answer executeRequest(Command cmd) { - if (cmd instanceof VmDataCommand) { - return execute((VmDataCommand) cmd); - } else if (cmd instanceof SavePasswordCommand) { - return execute((SavePasswordCommand) cmd); - } - return super.executeRequest(cmd); - } - - protected Answer execute(final VmDataCommand cmd) { - return _vmDataServer.handleVmDataCommand(cmd); - } - - protected Answer execute(final SavePasswordCommand cmd) { - return new Answer(cmd); - } - -} diff --git a/agent/src/com/cloud/agent/resource/computing/FakeComputingResource.java b/agent/src/com/cloud/agent/resource/computing/FakeComputingResource.java index b7e9cb08aa3..d9b5d949c44 100644 --- a/agent/src/com/cloud/agent/resource/computing/FakeComputingResource.java +++ b/agent/src/com/cloud/agent/resource/computing/FakeComputingResource.java @@ -110,536 +110,536 @@ import com.cloud.vm.VirtualMachine.State; */ @Local(value = { ServerResource.class }) public class FakeComputingResource extends ServerResourceBase implements - ServerResource { - private static final Logger s_logger = Logger - .getLogger(FakeComputingResource.class); - private Map _params; - private VmMgr _vmManager = new MockVmMgr(); - protected HashMap _vms = new HashMap(20); - protected DhcpSnooper _dhcpSnooper = new FakeDhcpSnooper(); - protected VmDataServer _vmDataServer = new JettyVmDataServer(); - - @Override - public Type getType() { - return Type.Routing; - } - - @Override - public StartupCommand[] initialize() { - Map changes = null; - - final List info = getHostInfo(); - - final StartupRoutingCommand cmd = new StartupRoutingCommand( - (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), - (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, - RouterPrivateIpStrategy.HostLocal, changes); - fillNetworkInformation(cmd); - cmd.getHostDetails().putAll(getVersionStrings()); - cmd.setCluster(getConfiguredProperty("cluster", "1")); - StoragePoolInfo pi = initializeLocalStorage(); - StartupStorageCommand sscmd = new StartupStorageCommand(); - sscmd.setPoolInfo(pi); - sscmd.setGuid(pi.getUuid()); - sscmd.setDataCenter((String) _params.get("zone")); - sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); - - return new StartupCommand[] { cmd, sscmd }; - - } - - private Map getVersionStrings() { - Map result = new HashMap(); - String hostOs = (String) _params.get("Host.OS"); - String hostOsVer = (String) _params.get("Host.OS.Version"); - String hostOsKernVer = (String) _params.get("Host.OS.Kernel.Version"); - result.put("Host.OS", hostOs == null ? "Fedora" : hostOs); - result.put("Host.OS.Version", hostOsVer == null ? "14" : hostOsVer); - result.put("Host.OS.Kernel.Version", - hostOsKernVer == null ? "2.6.35.6-45.fc14.x86_64" - : hostOsKernVer); - return result; - } - - protected void fillNetworkInformation(final StartupCommand cmd) { - - cmd.setPrivateIpAddress((String) _params.get("private.ip.address")); - cmd.setPrivateMacAddress((String) _params.get("private.mac.address")); - cmd.setPrivateNetmask((String) _params.get("private.ip.netmask")); - - cmd.setStorageIpAddress((String) _params.get("private.ip.address")); - cmd.setStorageMacAddress((String) _params.get("private.mac.address")); - cmd.setStorageNetmask((String) _params.get("private.ip.netmask")); - cmd.setGatewayIpAddress((String) _params.get("gateway.ip.address")); - - } - - protected StoragePoolInfo initializeLocalStorage() { - String hostIp = (String) _params.get("private.ip.address"); - String localStoragePath = (String) _params.get("local.storage.path"); - String lh = hostIp + localStoragePath; - String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString(); - - String capacity = (String) _params.get("local.storage.capacity"); - String available = (String) _params.get("local.storage.avail"); - - return new StoragePoolInfo(uuid, hostIp, localStoragePath, - localStoragePath, StoragePoolType.Filesystem, - Long.parseLong(capacity), Long.parseLong(available)); - - } - - @Override - public PingCommand getCurrentStatus(long id) { - final HashMap newStates = new HashMap(); - _dhcpSnooper.syncIpAddr(); - return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, - newStates); - } - - @Override - public Answer executeRequest(Command cmd) { - try { - if (cmd instanceof ReadyCommand) { - return execute((ReadyCommand) cmd); - } else if (cmd instanceof ModifySshKeysCommand) { - return execute((ModifySshKeysCommand) cmd);// TODO: remove - } else if (cmd instanceof GetHostStatsCommand) { - return execute((GetHostStatsCommand) cmd); - } else if (cmd instanceof PrimaryStorageDownloadCommand) { - return execute((PrimaryStorageDownloadCommand) cmd); - - } else if (cmd instanceof StopCommand) { - return execute((StopCommand) cmd); - } else if (cmd instanceof GetVmStatsCommand) { - return execute((GetVmStatsCommand) cmd); - } else if (cmd instanceof RebootCommand) { - return execute((RebootCommand) cmd); - } else if (cmd instanceof CheckStateCommand) { - return executeRequest(cmd); - } else if (cmd instanceof CheckHealthCommand) { - return execute((CheckHealthCommand) cmd); - } else if (cmd instanceof PingTestCommand) { - return execute((PingTestCommand) cmd); - } else if (cmd instanceof CheckVirtualMachineCommand) { - return execute((CheckVirtualMachineCommand) cmd); - } else if (cmd instanceof ReadyCommand) { - return execute((ReadyCommand) cmd); - } else if (cmd instanceof StopCommand) { - return execute((StopCommand) cmd); - } else if (cmd instanceof CreateCommand) { - return execute((CreateCommand) cmd); - } else if (cmd instanceof DestroyCommand) { - return execute((DestroyCommand) cmd); - } else if (cmd instanceof PrimaryStorageDownloadCommand) { - return execute((PrimaryStorageDownloadCommand) cmd); - } else if (cmd instanceof GetStorageStatsCommand) { - return execute((GetStorageStatsCommand) cmd); - } else if (cmd instanceof ModifyStoragePoolCommand) { - return execute((ModifyStoragePoolCommand) cmd); - } else if (cmd instanceof SecurityGroupRulesCmd) { - return execute((SecurityGroupRulesCmd) cmd); - } else if (cmd instanceof StartCommand) { - return execute((StartCommand) cmd); - } else if (cmd instanceof CleanupNetworkRulesCmd) { - return execute((CleanupNetworkRulesCmd) cmd); - } else if (cmd instanceof SavePasswordCommand) { - return execute((SavePasswordCommand) cmd); - } else if (cmd instanceof VmDataCommand) { - return execute((VmDataCommand) cmd); - } else { - s_logger.warn("Unsupported command "); - return Answer.createUnsupportedCommandAnswer(cmd); - } - } catch (final IllegalArgumentException e) { - return new Answer(cmd, false, e.getMessage()); - } - } - - private Answer execute(CleanupNetworkRulesCmd cmd) { - return new Answer(cmd); - } - - private Answer execute(SecurityGroupRulesCmd cmd) { - s_logger.info("Programmed network rules for vm " + cmd.getVmName() - + " guestIp=" + cmd.getGuestIp() + ",ingress numrules=" - + cmd.getIngressRuleSet().length + ",egress numrules=" - + cmd.getEgressRuleSet().length); - return new SecurityGroupRuleAnswer(cmd); - } - - private Answer execute(ModifyStoragePoolCommand cmd) { - long capacity = getConfiguredProperty("local.storage.capacity", - 10000000000L); - long used = 10000000L; - long available = capacity - used; - if (cmd.getAdd()) { - - ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, - capacity, used, new HashMap()); - - if (s_logger.isInfoEnabled()) - s_logger.info("Sending ModifyStoragePoolCommand answer with capacity: " - + capacity - + ", used: " - + used - + ", available: " - + available); - return answer; - } else { - if (s_logger.isInfoEnabled()) - s_logger.info("ModifyNetfsStoragePoolCmd is not add command, cmd: " - + cmd.toString()); - return new Answer(cmd); - } - } - - private Answer execute(GetStorageStatsCommand cmd) { - return new GetStorageStatsAnswer(cmd, getConfiguredProperty( - "local.storage.capacity", 100000000000L), 0L); - } - - protected synchronized ReadyAnswer execute(ReadyCommand cmd) { - return new ReadyAnswer(cmd); - } - - private Answer execute(PrimaryStorageDownloadCommand cmd) { - return new PrimaryStorageDownloadAnswer(cmd.getLocalPath(), 16000000L); - } - - private Answer execute(ModifySshKeysCommand cmd) { - return new Answer(cmd, true, null); - } - - @Override - protected String getDefaultScriptsDir() { - return null; - } - - protected String getConfiguredProperty(String key, String defaultValue) { - String val = (String) _params.get(key); - return val == null ? defaultValue : val; - } - - protected Long getConfiguredProperty(String key, Long defaultValue) { - String val = (String) _params.get(key); - - if (val != null) { - Long result = Long.parseLong(val); - return result; - } - return defaultValue; - } - - protected List getHostInfo() { - final ArrayList info = new ArrayList(); - long speed = getConfiguredProperty("cpuspeed", 4000L); - long cpus = getConfiguredProperty("cpus", 4L); - long ram = getConfiguredProperty("memory", 16000L * 1024L * 1024L); - long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L); - - String cap = getConfiguredProperty("capabilities", "hvm"); - info.add((int) cpus); - info.add(speed); - info.add(ram); - info.add(cap); - info.add(dom0ram); - return info; - - } - - private Map getSimulatorProperties() - throws ConfigurationException { - final File file = PropertiesUtil.findConfigFile("simulator.properties"); - if (file == null) { - throw new ConfigurationException( - "Unable to find simulator.properties."); - } - - s_logger.info("simulator.properties found at " + file.getAbsolutePath()); - Properties properties = new Properties(); - try { - properties.load(new FileInputStream(file)); - - final Map params = PropertiesUtil.toMap(properties); - - return params; - } catch (final FileNotFoundException ex) { - throw new CloudRuntimeException("Cannot find the file: " - + file.getAbsolutePath(), ex); - } catch (final IOException ex) { - throw new CloudRuntimeException("IOException in reading " - + file.getAbsolutePath(), ex); - } - } - - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - Map simProps = getSimulatorProperties(); - params.putAll(simProps); - setParams(params); - _vmManager.configure(params); - _dhcpSnooper.configure(name, params); - _vmDataServer.configure(name, params); - return true; - } - - public void setParams(Map _params) { - this._params = _params; - } - - public Map getParams() { - return _params; - } - - protected synchronized StartAnswer execute(StartCommand cmd) { - VmMgr vmMgr = getVmManager(); - - VirtualMachineTO vmSpec = cmd.getVirtualMachine(); - String vmName = vmSpec.getName(); - State state = State.Stopped; - - try { - if (!_vms.containsKey(vmName)) { - synchronized (_vms) { - _vms.put(vmName, State.Starting); - } - - MockVm vm = vmMgr.createVmFromSpec(vmSpec); - vmMgr.createVbd(vmSpec, vmName, vm); - vmMgr.createVif(vmSpec, vmName, vm); - - state = State.Running; - for (NicTO nic : cmd.getVirtualMachine().getNics()) { - if (nic.getType() == TrafficType.Guest) { - InetAddress addr = _dhcpSnooper.getIPAddr(nic.getMac(), - vmName); - nic.setIp(addr.getHostAddress()); - } - } - _vmDataServer.handleVmStarted(cmd.getVirtualMachine()); - return new StartAnswer(cmd); - } else { - String msg = "There is already a VM having the same name " - + vmName; - s_logger.warn(msg); - return new StartAnswer(cmd, msg); - } - } catch (Exception ex) { - - } finally { - synchronized (_vms) { - _vms.put(vmName, state); - } - } - return new StartAnswer(cmd); - } - - protected synchronized StopAnswer execute(StopCommand cmd) { - VmMgr vmMgr = getVmManager(); - - StopAnswer answer = null; - String vmName = cmd.getVmName(); - - Integer port = vmMgr.getVncPort(vmName); - Long bytesReceived = null; - Long bytesSent = null; - - State state = null; - synchronized (_vms) { - state = _vms.get(vmName); - _vms.put(vmName, State.Stopping); - } - try { - String result = vmMgr.stopVM(vmName, false); - if (result != null) { - s_logger.info("Trying destroy on " + vmName); - if (result == Script.ERR_TIMEOUT) { - result = vmMgr.stopVM(vmName, true); - } - - s_logger.warn("Couldn't stop " + vmName); - - if (result != null) { - return new StopAnswer(cmd, result); - } - } - - answer = new StopAnswer(cmd, null, port, bytesSent, bytesReceived); - - String result2 = vmMgr.cleanupVnet(cmd.getVnet()); - if (result2 != null) { - result = result2 + (result != null ? ("\n" + result) : ""); - answer = new StopAnswer(cmd, result, port, bytesSent, - bytesReceived); - } - - _dhcpSnooper.cleanup(vmName, null); - - return answer; - } finally { - if (answer == null || !answer.getResult()) { - synchronized (_vms) { - _vms.put(vmName, state); - } - } - } - } - - protected Answer execute(final VmDataCommand cmd) { - return _vmDataServer.handleVmDataCommand(cmd); - } - - protected Answer execute(final SavePasswordCommand cmd) { - return new Answer(cmd); - } - - protected Answer execute(RebootCommand cmd) { - VmMgr vmMgr = getVmManager(); - vmMgr.rebootVM(cmd.getVmName()); - return new RebootAnswer(cmd, "success", 0L, 0L); - } - - private Answer execute(PingTestCommand cmd) { - return new Answer(cmd); - } - - protected GetVmStatsAnswer execute(GetVmStatsCommand cmd) { - return null; - } - - private VmMgr getVmManager() { - return _vmManager; - } - - protected Answer execute(GetHostStatsCommand cmd) { - VmMgr vmMgr = getVmManager(); - return new GetHostStatsAnswer(cmd, vmMgr.getHostCpuUtilization(), - vmMgr.getHostFreeMemory(), vmMgr.getHostTotalMemory(), 0, 0, - "SimulatedHost"); - } - - protected CheckStateAnswer execute(CheckStateCommand cmd) { - State state = getVmManager().checkVmState(cmd.getVmName()); - return new CheckStateAnswer(cmd, state); - } - - protected CheckHealthAnswer execute(CheckHealthCommand cmd) { - return new CheckHealthAnswer(cmd, true); - } - - protected CheckVirtualMachineAnswer execute( - final CheckVirtualMachineCommand cmd) { - VmMgr vmMgr = getVmManager(); - final String vmName = cmd.getVmName(); - - final State state = vmMgr.checkVmState(vmName); - Integer vncPort = null; - if (state == State.Running) { - vncPort = vmMgr.getVncPort(vmName); - synchronized (_vms) { - _vms.put(vmName, State.Running); - } - } - return new CheckVirtualMachineAnswer(cmd, state, vncPort); - } - - protected Answer execute(final AttachVolumeCommand cmd) { - return new Answer(cmd); - } - - protected Answer execute(final AttachIsoCommand cmd) { - return new Answer(cmd); - } - - protected CreateAnswer execute(final CreateCommand cmd) { - try { - - VolumeTO vol = new VolumeTO(cmd.getVolumeId(), Volume.Type.ROOT, - com.cloud.storage.Storage.StoragePoolType.LVM, cmd - .getPool().getUuid(), "dummy", "/mountpoint", - "dummyPath", 1000L, null); - return new CreateAnswer(cmd, vol); - } catch (Throwable th) { - return new CreateAnswer(cmd, new Exception("Unexpected exception")); - } - } - - protected HashMap sync() { - Map newStates; - Map oldStates = null; - - HashMap changes = new HashMap(); - - synchronized (_vms) { - newStates = getVmManager().getVmStates(); - oldStates = new HashMap(_vms.size()); - oldStates.putAll(_vms); - - for (Map.Entry entry : newStates.entrySet()) { - String vm = entry.getKey(); - - State newState = entry.getValue(); - State oldState = oldStates.remove(vm); - - if (s_logger.isTraceEnabled()) { - s_logger.trace("VM " + vm + ": xen has state " + newState - + " and we have state " - + (oldState != null ? oldState.toString() : "null")); - } - - if (oldState == null) { - _vms.put(vm, newState); - changes.put(vm, newState); - } else if (oldState == State.Starting) { - if (newState == State.Running) { - _vms.put(vm, newState); - } else if (newState == State.Stopped) { - s_logger.debug("Ignoring vm " + vm - + " because of a lag in starting the vm."); - } - } else if (oldState == State.Stopping) { - if (newState == State.Stopped) { - _vms.put(vm, newState); - } else if (newState == State.Running) { - s_logger.debug("Ignoring vm " + vm - + " because of a lag in stopping the vm. "); - } - } else if (oldState != newState) { - _vms.put(vm, newState); - changes.put(vm, newState); - } - } - - for (Map.Entry entry : oldStates.entrySet()) { - String vm = entry.getKey(); - State oldState = entry.getValue(); - - if (s_logger.isTraceEnabled()) { - s_logger.trace("VM " + vm - + " is now missing from xen so reporting stopped"); - } - - if (oldState == State.Stopping) { - s_logger.debug("Ignoring VM " + vm - + " in transition state stopping."); - _vms.remove(vm); - } else if (oldState == State.Starting) { - s_logger.debug("Ignoring VM " + vm - + " in transition state starting."); - } else if (oldState == State.Stopped) { - _vms.remove(vm); - } else { - changes.put(entry.getKey(), State.Stopped); - } - } - } - - return changes; - } - - protected Answer execute(DestroyCommand cmd) { - return new Answer(cmd, true, null); - } + ServerResource { + private static final Logger s_logger = Logger + .getLogger(FakeComputingResource.class); + private Map _params; + private VmMgr _vmManager = new MockVmMgr(); + protected HashMap _vms = new HashMap(20); + protected DhcpSnooper _dhcpSnooper = new FakeDhcpSnooper(); + protected VmDataServer _vmDataServer = new JettyVmDataServer(); + + @Override + public Type getType() { + return Type.Routing; + } + + @Override + public StartupCommand[] initialize() { + Map changes = null; + + final List info = getHostInfo(); + + final StartupRoutingCommand cmd = new StartupRoutingCommand( + (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), + (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, + RouterPrivateIpStrategy.HostLocal, changes); + fillNetworkInformation(cmd); + cmd.getHostDetails().putAll(getVersionStrings()); + cmd.setCluster(getConfiguredProperty("cluster", "1")); + StoragePoolInfo pi = initializeLocalStorage(); + StartupStorageCommand sscmd = new StartupStorageCommand(); + sscmd.setPoolInfo(pi); + sscmd.setGuid(pi.getUuid()); + sscmd.setDataCenter((String) _params.get("zone")); + sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); + + return new StartupCommand[] { cmd, sscmd }; + + } + + private Map getVersionStrings() { + Map result = new HashMap(); + String hostOs = (String) _params.get("Host.OS"); + String hostOsVer = (String) _params.get("Host.OS.Version"); + String hostOsKernVer = (String) _params.get("Host.OS.Kernel.Version"); + result.put("Host.OS", hostOs == null ? "Fedora" : hostOs); + result.put("Host.OS.Version", hostOsVer == null ? "14" : hostOsVer); + result.put("Host.OS.Kernel.Version", + hostOsKernVer == null ? "2.6.35.6-45.fc14.x86_64" + : hostOsKernVer); + return result; + } + + protected void fillNetworkInformation(final StartupCommand cmd) { + + cmd.setPrivateIpAddress((String) _params.get("private.ip.address")); + cmd.setPrivateMacAddress((String) _params.get("private.mac.address")); + cmd.setPrivateNetmask((String) _params.get("private.ip.netmask")); + + cmd.setStorageIpAddress((String) _params.get("private.ip.address")); + cmd.setStorageMacAddress((String) _params.get("private.mac.address")); + cmd.setStorageNetmask((String) _params.get("private.ip.netmask")); + cmd.setGatewayIpAddress((String) _params.get("gateway.ip.address")); + + } + + protected StoragePoolInfo initializeLocalStorage() { + String hostIp = (String) _params.get("private.ip.address"); + String localStoragePath = (String) _params.get("local.storage.path"); + String lh = hostIp + localStoragePath; + String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString(); + + String capacity = (String) _params.get("local.storage.capacity"); + String available = (String) _params.get("local.storage.avail"); + + return new StoragePoolInfo(uuid, hostIp, localStoragePath, + localStoragePath, StoragePoolType.Filesystem, + Long.parseLong(capacity), Long.parseLong(available)); + + } + + @Override + public PingCommand getCurrentStatus(long id) { + final HashMap newStates = new HashMap(); + _dhcpSnooper.syncIpAddr(); + return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, + newStates); + } + + @Override + public Answer executeRequest(Command cmd) { + try { + if (cmd instanceof ReadyCommand) { + return execute((ReadyCommand) cmd); + } else if (cmd instanceof ModifySshKeysCommand) { + return execute((ModifySshKeysCommand) cmd);// TODO: remove + } else if (cmd instanceof GetHostStatsCommand) { + return execute((GetHostStatsCommand) cmd); + } else if (cmd instanceof PrimaryStorageDownloadCommand) { + return execute((PrimaryStorageDownloadCommand) cmd); + + } else if (cmd instanceof StopCommand) { + return execute((StopCommand) cmd); + } else if (cmd instanceof GetVmStatsCommand) { + return execute((GetVmStatsCommand) cmd); + } else if (cmd instanceof RebootCommand) { + return execute((RebootCommand) cmd); + } else if (cmd instanceof CheckStateCommand) { + return executeRequest(cmd); + } else if (cmd instanceof CheckHealthCommand) { + return execute((CheckHealthCommand) cmd); + } else if (cmd instanceof PingTestCommand) { + return execute((PingTestCommand) cmd); + } else if (cmd instanceof CheckVirtualMachineCommand) { + return execute((CheckVirtualMachineCommand) cmd); + } else if (cmd instanceof ReadyCommand) { + return execute((ReadyCommand) cmd); + } else if (cmd instanceof StopCommand) { + return execute((StopCommand) cmd); + } else if (cmd instanceof CreateCommand) { + return execute((CreateCommand) cmd); + } else if (cmd instanceof DestroyCommand) { + return execute((DestroyCommand) cmd); + } else if (cmd instanceof PrimaryStorageDownloadCommand) { + return execute((PrimaryStorageDownloadCommand) cmd); + } else if (cmd instanceof GetStorageStatsCommand) { + return execute((GetStorageStatsCommand) cmd); + } else if (cmd instanceof ModifyStoragePoolCommand) { + return execute((ModifyStoragePoolCommand) cmd); + } else if (cmd instanceof SecurityGroupRulesCmd) { + return execute((SecurityGroupRulesCmd) cmd); + } else if (cmd instanceof StartCommand) { + return execute((StartCommand) cmd); + } else if (cmd instanceof CleanupNetworkRulesCmd) { + return execute((CleanupNetworkRulesCmd) cmd); + } else if (cmd instanceof SavePasswordCommand) { + return execute((SavePasswordCommand) cmd); + } else if (cmd instanceof VmDataCommand) { + return execute((VmDataCommand) cmd); + } else { + s_logger.warn("Unsupported command "); + return Answer.createUnsupportedCommandAnswer(cmd); + } + } catch (final IllegalArgumentException e) { + return new Answer(cmd, false, e.getMessage()); + } + } + + private Answer execute(CleanupNetworkRulesCmd cmd) { + return new Answer(cmd); + } + + private Answer execute(SecurityGroupRulesCmd cmd) { + s_logger.info("Programmed network rules for vm " + cmd.getVmName() + + " guestIp=" + cmd.getGuestIp() + ",ingress numrules=" + + cmd.getIngressRuleSet().length + ",egress numrules=" + + cmd.getEgressRuleSet().length); + return new SecurityGroupRuleAnswer(cmd); + } + + private Answer execute(ModifyStoragePoolCommand cmd) { + long capacity = getConfiguredProperty("local.storage.capacity", + 10000000000L); + long used = 10000000L; + long available = capacity - used; + if (cmd.getAdd()) { + + ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, + capacity, used, new HashMap()); + + if (s_logger.isInfoEnabled()) + s_logger.info("Sending ModifyStoragePoolCommand answer with capacity: " + + capacity + + ", used: " + + used + + ", available: " + + available); + return answer; + } else { + if (s_logger.isInfoEnabled()) + s_logger.info("ModifyNetfsStoragePoolCmd is not add command, cmd: " + + cmd.toString()); + return new Answer(cmd); + } + } + + private Answer execute(GetStorageStatsCommand cmd) { + return new GetStorageStatsAnswer(cmd, getConfiguredProperty( + "local.storage.capacity", 100000000000L), 0L); + } + + protected synchronized ReadyAnswer execute(ReadyCommand cmd) { + return new ReadyAnswer(cmd); + } + + private Answer execute(PrimaryStorageDownloadCommand cmd) { + return new PrimaryStorageDownloadAnswer(cmd.getLocalPath(), 16000000L); + } + + private Answer execute(ModifySshKeysCommand cmd) { + return new Answer(cmd, true, null); + } + + @Override + protected String getDefaultScriptsDir() { + return null; + } + + protected String getConfiguredProperty(String key, String defaultValue) { + String val = (String) _params.get(key); + return val == null ? defaultValue : val; + } + + protected Long getConfiguredProperty(String key, Long defaultValue) { + String val = (String) _params.get(key); + + if (val != null) { + Long result = Long.parseLong(val); + return result; + } + return defaultValue; + } + + protected List getHostInfo() { + final ArrayList info = new ArrayList(); + long speed = getConfiguredProperty("cpuspeed", 4000L); + long cpus = getConfiguredProperty("cpus", 4L); + long ram = getConfiguredProperty("memory", 16000L * 1024L * 1024L); + long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L); + + String cap = getConfiguredProperty("capabilities", "hvm"); + info.add((int) cpus); + info.add(speed); + info.add(ram); + info.add(cap); + info.add(dom0ram); + return info; + + } + + private Map getSimulatorProperties() + throws ConfigurationException { + final File file = PropertiesUtil.findConfigFile("simulator.properties"); + if (file == null) { + throw new ConfigurationException( + "Unable to find simulator.properties."); + } + + s_logger.info("simulator.properties found at " + file.getAbsolutePath()); + Properties properties = new Properties(); + try { + properties.load(new FileInputStream(file)); + + final Map params = PropertiesUtil.toMap(properties); + + return params; + } catch (final FileNotFoundException ex) { + throw new CloudRuntimeException("Cannot find the file: " + + file.getAbsolutePath(), ex); + } catch (final IOException ex) { + throw new CloudRuntimeException("IOException in reading " + + file.getAbsolutePath(), ex); + } + } + + @Override + public boolean configure(String name, Map params) + throws ConfigurationException { + Map simProps = getSimulatorProperties(); + params.putAll(simProps); + setParams(params); + _vmManager.configure(params); + _dhcpSnooper.configure(name, params); + _vmDataServer.configure(name, params); + return true; + } + + public void setParams(Map _params) { + this._params = _params; + } + + public Map getParams() { + return _params; + } + + protected synchronized StartAnswer execute(StartCommand cmd) { + VmMgr vmMgr = getVmManager(); + + VirtualMachineTO vmSpec = cmd.getVirtualMachine(); + String vmName = vmSpec.getName(); + State state = State.Stopped; + + try { + if (!_vms.containsKey(vmName)) { + synchronized (_vms) { + _vms.put(vmName, State.Starting); + } + + MockVm vm = vmMgr.createVmFromSpec(vmSpec); + vmMgr.createVbd(vmSpec, vmName, vm); + vmMgr.createVif(vmSpec, vmName, vm); + + state = State.Running; + for (NicTO nic : cmd.getVirtualMachine().getNics()) { + if (nic.getType() == TrafficType.Guest) { + InetAddress addr = _dhcpSnooper.getIPAddr(nic.getMac(), + vmName); + nic.setIp(addr.getHostAddress()); + } + } + _vmDataServer.handleVmStarted(cmd.getVirtualMachine()); + return new StartAnswer(cmd); + } else { + String msg = "There is already a VM having the same name " + + vmName; + s_logger.warn(msg); + return new StartAnswer(cmd, msg); + } + } catch (Exception ex) { + + } finally { + synchronized (_vms) { + _vms.put(vmName, state); + } + } + return new StartAnswer(cmd); + } + + protected synchronized StopAnswer execute(StopCommand cmd) { + VmMgr vmMgr = getVmManager(); + + StopAnswer answer = null; + String vmName = cmd.getVmName(); + + Integer port = vmMgr.getVncPort(vmName); + Long bytesReceived = null; + Long bytesSent = null; + + State state = null; + synchronized (_vms) { + state = _vms.get(vmName); + _vms.put(vmName, State.Stopping); + } + try { + String result = vmMgr.stopVM(vmName, false); + if (result != null) { + s_logger.info("Trying destroy on " + vmName); + if (result == Script.ERR_TIMEOUT) { + result = vmMgr.stopVM(vmName, true); + } + + s_logger.warn("Couldn't stop " + vmName); + + if (result != null) { + return new StopAnswer(cmd, result); + } + } + + answer = new StopAnswer(cmd, null, port, bytesSent, bytesReceived); + + String result2 = vmMgr.cleanupVnet(cmd.getVnet()); + if (result2 != null) { + result = result2 + (result != null ? ("\n" + result) : ""); + answer = new StopAnswer(cmd, result, port, bytesSent, + bytesReceived); + } + + _dhcpSnooper.cleanup(vmName, null); + + return answer; + } finally { + if (answer == null || !answer.getResult()) { + synchronized (_vms) { + _vms.put(vmName, state); + } + } + } + } + + protected Answer execute(final VmDataCommand cmd) { + return _vmDataServer.handleVmDataCommand(cmd); + } + + protected Answer execute(final SavePasswordCommand cmd) { + return new Answer(cmd); + } + + protected Answer execute(RebootCommand cmd) { + VmMgr vmMgr = getVmManager(); + vmMgr.rebootVM(cmd.getVmName()); + return new RebootAnswer(cmd, "success", 0L, 0L); + } + + private Answer execute(PingTestCommand cmd) { + return new Answer(cmd); + } + + protected GetVmStatsAnswer execute(GetVmStatsCommand cmd) { + return null; + } + + private VmMgr getVmManager() { + return _vmManager; + } + + protected Answer execute(GetHostStatsCommand cmd) { + VmMgr vmMgr = getVmManager(); + return new GetHostStatsAnswer(cmd, vmMgr.getHostCpuUtilization(), + vmMgr.getHostFreeMemory(), vmMgr.getHostTotalMemory(), 0, 0, + "SimulatedHost"); + } + + protected CheckStateAnswer execute(CheckStateCommand cmd) { + State state = getVmManager().checkVmState(cmd.getVmName()); + return new CheckStateAnswer(cmd, state); + } + + protected CheckHealthAnswer execute(CheckHealthCommand cmd) { + return new CheckHealthAnswer(cmd, true); + } + + protected CheckVirtualMachineAnswer execute( + final CheckVirtualMachineCommand cmd) { + VmMgr vmMgr = getVmManager(); + final String vmName = cmd.getVmName(); + + final State state = vmMgr.checkVmState(vmName); + Integer vncPort = null; + if (state == State.Running) { + vncPort = vmMgr.getVncPort(vmName); + synchronized (_vms) { + _vms.put(vmName, State.Running); + } + } + return new CheckVirtualMachineAnswer(cmd, state, vncPort); + } + + protected Answer execute(final AttachVolumeCommand cmd) { + return new Answer(cmd); + } + + protected Answer execute(final AttachIsoCommand cmd) { + return new Answer(cmd); + } + + protected CreateAnswer execute(final CreateCommand cmd) { + try { + + VolumeTO vol = new VolumeTO(cmd.getVolumeId(), Volume.Type.ROOT, + com.cloud.storage.Storage.StoragePoolType.LVM, cmd + .getPool().getUuid(), "dummy", "/mountpoint", + "dummyPath", 1000L, null); + return new CreateAnswer(cmd, vol); + } catch (Throwable th) { + return new CreateAnswer(cmd, new Exception("Unexpected exception")); + } + } + + protected HashMap sync() { + Map newStates; + Map oldStates = null; + + HashMap changes = new HashMap(); + + synchronized (_vms) { + newStates = getVmManager().getVmStates(); + oldStates = new HashMap(_vms.size()); + oldStates.putAll(_vms); + + for (Map.Entry entry : newStates.entrySet()) { + String vm = entry.getKey(); + + State newState = entry.getValue(); + State oldState = oldStates.remove(vm); + + if (s_logger.isTraceEnabled()) { + s_logger.trace("VM " + vm + ": xen has state " + newState + + " and we have state " + + (oldState != null ? oldState.toString() : "null")); + } + + if (oldState == null) { + _vms.put(vm, newState); + changes.put(vm, newState); + } else if (oldState == State.Starting) { + if (newState == State.Running) { + _vms.put(vm, newState); + } else if (newState == State.Stopped) { + s_logger.debug("Ignoring vm " + vm + + " because of a lag in starting the vm."); + } + } else if (oldState == State.Stopping) { + if (newState == State.Stopped) { + _vms.put(vm, newState); + } else if (newState == State.Running) { + s_logger.debug("Ignoring vm " + vm + + " because of a lag in stopping the vm. "); + } + } else if (oldState != newState) { + _vms.put(vm, newState); + changes.put(vm, newState); + } + } + + for (Map.Entry entry : oldStates.entrySet()) { + String vm = entry.getKey(); + State oldState = entry.getValue(); + + if (s_logger.isTraceEnabled()) { + s_logger.trace("VM " + vm + + " is now missing from xen so reporting stopped"); + } + + if (oldState == State.Stopping) { + s_logger.debug("Ignoring VM " + vm + + " in transition state stopping."); + _vms.remove(vm); + } else if (oldState == State.Starting) { + s_logger.debug("Ignoring VM " + vm + + " in transition state starting."); + } else if (oldState == State.Stopped) { + _vms.remove(vm); + } else { + changes.put(entry.getKey(), State.Stopped); + } + } + } + + return changes; + } + + protected Answer execute(DestroyCommand cmd) { + return new Answer(cmd, true, null); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/KVMGuestOsMapper.java b/agent/src/com/cloud/agent/resource/computing/KVMGuestOsMapper.java index fceece42ce4..22f3935c59c 100644 --- a/agent/src/com/cloud/agent/resource/computing/KVMGuestOsMapper.java +++ b/agent/src/com/cloud/agent/resource/computing/KVMGuestOsMapper.java @@ -22,148 +22,148 @@ import java.util.Map; import org.apache.log4j.Logger; public class KVMGuestOsMapper { - private static final Logger s_logger = Logger - .getLogger(KVMGuestOsMapper.class); - private static Map s_mapper = new HashMap(); - static { - s_mapper.put("CentOS 4.5 (32-bit)", "CentOS 4.5"); - s_mapper.put("CentOS 4.6 (32-bit)", "CentOS 4.6"); - s_mapper.put("CentOS 4.7 (32-bit)", "CentOS 4.7"); - s_mapper.put("CentOS 4.8 (32-bit)", "CentOS 4.8"); - s_mapper.put("CentOS 5.0 (32-bit)", "CentOS 5.0"); - s_mapper.put("CentOS 5.0 (64-bit)", "CentOS 5.0"); - s_mapper.put("CentOS 5.1 (32-bit)", "CentOS 5.1"); - s_mapper.put("CentOS 5.1 (64-bit)", "CentOS 5.1"); - s_mapper.put("CentOS 5.2 (32-bit)", "CentOS 5.2"); - s_mapper.put("CentOS 5.2 (64-bit)", "CentOS 5.2"); - s_mapper.put("CentOS 5.3 (32-bit)", "CentOS 5.3"); - s_mapper.put("CentOS 5.3 (64-bit)", "CentOS 5.3"); - s_mapper.put("CentOS 5.4 (32-bit)", "CentOS 5.4"); - s_mapper.put("CentOS 5.4 (64-bit)", "CentOS 5.4"); - s_mapper.put("CentOS 5.5 (32-bit)", "CentOS 5.5"); - s_mapper.put("CentOS 5.5 (64-bit)", "CentOS 5.5"); - s_mapper.put("Red Hat Enterprise Linux 2", "Red Hat Enterprise Linux 2"); - s_mapper.put("Red Hat Enterprise Linux 3 (32-bit)", - "Red Hat Enterprise Linux 3"); - s_mapper.put("Red Hat Enterprise Linux 3 (64-bit)", - "Red Hat Enterprise Linux 3"); - s_mapper.put("Red Hat Enterprise Linux 4(64-bit)", - "Red Hat Enterprise Linux 4"); - s_mapper.put("Red Hat Enterprise Linux 4.5 (32-bit)", - "Red Hat Enterprise Linux 4.5"); - s_mapper.put("Red Hat Enterprise Linux 4.6 (32-bit)", - "Red Hat Enterprise Linux 4.6"); - s_mapper.put("Red Hat Enterprise Linux 4.7 (32-bit)", - "Red Hat Enterprise Linux 4.7"); - s_mapper.put("Red Hat Enterprise Linux 4.8 (32-bit)", - "Red Hat Enterprise Linux 4.8"); - s_mapper.put("Red Hat Enterprise Linux 5.0 (32-bit)", - "Red Hat Enterprise Linux 5.0"); - s_mapper.put("Red Hat Enterprise Linux 5.0 (64-bit)", - "Red Hat Enterprise Linux 5.0"); - s_mapper.put("Red Hat Enterprise Linux 5.1 (32-bit)", - "Red Hat Enterprise Linux 5.1"); - s_mapper.put("Red Hat Enterprise Linux 5.1 (32-bit)", - "Red Hat Enterprise Linux 5.1"); - s_mapper.put("Red Hat Enterprise Linux 5.2 (32-bit)", - "Red Hat Enterprise Linux 5.2"); - s_mapper.put("Red Hat Enterprise Linux 5.2 (64-bit)", - "Red Hat Enterprise Linux 5.2"); - s_mapper.put("Red Hat Enterprise Linux 5.3 (32-bit)", - "Red Hat Enterprise Linux 5.3"); - s_mapper.put("Red Hat Enterprise Linux 5.3 (64-bit)", - "Red Hat Enterprise Linux 5.3"); - s_mapper.put("Red Hat Enterprise Linux 5.4 (32-bit)", - "Red Hat Enterprise Linux 5.4"); - s_mapper.put("Red Hat Enterprise Linux 5.4 (64-bit)", - "Red Hat Enterprise Linux 5.4"); - s_mapper.put("Red Hat Enterprise Linux 5.5 (32-bit)", - "Red Hat Enterprise Linux 5.5"); - s_mapper.put("Red Hat Enterprise Linux 5.5 (64-bit)", - "Red Hat Enterprise Linux 5.5"); - s_mapper.put("Red Hat Enterprise Linux 6.0 (32-bit)", - "Red Hat Enterprise Linux 6.0"); - s_mapper.put("Red Hat Enterprise Linux 6.0 (64-bit)", - "Red Hat Enterprise Linux 6.0"); - s_mapper.put("Fedora 13", "Fedora 13"); - s_mapper.put("Fedora 12", "Fedora 12"); - s_mapper.put("Fedora 11", "Fedora 11"); - s_mapper.put("Fedora 10", "Fedora 10"); - s_mapper.put("Fedora 9", "Fedora 9"); - s_mapper.put("Fedora 8", "Fedora 8"); - s_mapper.put("Ubuntu 10.04 (32-bit)", "Ubuntu 10.04"); - s_mapper.put("Ubuntu 10.04 (64-bit)", "Ubuntu 10.04"); - s_mapper.put("Ubuntu 10.10 (32-bit)", "Ubuntu 10.10"); - s_mapper.put("Ubuntu 10.10 (64-bit)", "Ubuntu 10.10"); - s_mapper.put("Ubuntu 9.10 (32-bit)", "Ubuntu 9.10"); - s_mapper.put("Ubuntu 9.10 (64-bit)", "Ubuntu 9.10"); - s_mapper.put("Ubuntu 9.04 (32-bit)", "Ubuntu 9.04"); - s_mapper.put("Ubuntu 9.04 (64-bit)", "Ubuntu 9.04"); - s_mapper.put("Ubuntu 8.10 (32-bit)", "Ubuntu 8.10"); - s_mapper.put("Ubuntu 8.10 (64-bit)", "Ubuntu 8.10"); - s_mapper.put("Ubuntu 8.04 (32-bit)", "Other Linux"); - s_mapper.put("Ubuntu 8.04 (64-bit)", "Other Linux"); - s_mapper.put("Debian GNU/Linux 5(32-bit)", "Debian GNU/Linux 5"); - s_mapper.put("Debian GNU/Linux 5(64-bit)", "Debian GNU/Linux 5"); - s_mapper.put("Debian GNU/Linux 4(32-bit)", "Debian GNU/Linux 4"); - s_mapper.put("Debian GNU/Linux 4(64-bit)", "Debian GNU/Linux 4"); - s_mapper.put("Debian GNU/Linux 6(64-bit)", "Debian GNU/Linux 6"); - s_mapper.put("Debian GNU/Linux 6(32-bit)", "Debian GNU/Linux 6"); - s_mapper.put("Other 2.6x Linux (32-bit)", "Other 2.6x Linux"); - s_mapper.put("Other 2.6x Linux (64-bit)", "Other 2.6x Linux"); - s_mapper.put("Other Linux (32-bit)", "Other Linux"); - s_mapper.put("Other Linux (64-bit)", "Other Linux"); - s_mapper.put("Other Ubuntu (32-bit)", "Other Linux"); - s_mapper.put("Other Ubuntu (64-bit)", "Other Linux"); - s_mapper.put("Asianux 3(32-bit)", "Other Linux"); - s_mapper.put("Asianux 3(64-bit)", "Other Linux"); - s_mapper.put("Windows 7 (32-bit)", "Windows 7"); - s_mapper.put("Windows 7 (64-bit)", "Windows 7"); - s_mapper.put("Windows Server 2003 Enterprise Edition(32-bit)", - "Windows Server 2003"); - s_mapper.put("Windows Server 2003 Enterprise Edition(64-bit)", - "Windows Server 2003"); - s_mapper.put("Windows Server 2003 DataCenter Edition(32-bit)", - "Windows Server 2003"); - s_mapper.put("Windows Server 2003 DataCenter Edition(64-bit)", - "Windows Server 2003"); - s_mapper.put("Windows Server 2003 Standard Edition(32-bit)", - "Windows Server 2003"); - s_mapper.put("Windows Server 2003 Standard Edition(64-bit)", - "Windows Server 2003"); - s_mapper.put("Windows Server 2003 Web Edition", "Windows Server 2003"); - s_mapper.put("Microsoft Small Bussiness Server 2003", - "Windows Server 2003"); - s_mapper.put("Windows Server 2008 (32-bit)", "Windows Server 2008"); - s_mapper.put("Windows Server 2008 (64-bit)", "Windows Server 2008"); - s_mapper.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008"); - s_mapper.put("Windows 2000 Server SP4 (32-bit)", "Windows 2000"); - s_mapper.put("Windows 2000 Server", "Windows 2000"); - s_mapper.put("Windows 2000 Advanced Server", "Windows 2000"); - s_mapper.put("Windows 2000 Professional", "Windows 2000"); - s_mapper.put("Windows Vista (32-bit)", "Windows Vista"); - s_mapper.put("Windows Vista (64-bit)", "Windows Vista"); - s_mapper.put("Windows XP SP2 (32-bit)", "Windows XP"); - s_mapper.put("Windows XP SP3 (32-bit)", "Windows XP"); - s_mapper.put("Windows XP (32-bit)", "Windows XP"); - s_mapper.put("Windows XP (64-bit)", "Windows XP"); - s_mapper.put("Windows 98", "Windows 98"); - s_mapper.put("Windows 95", "Windows 95"); - s_mapper.put("Windows NT 4", "Windows NT"); - s_mapper.put("Windows 3.1", "Windows 3.1"); - s_mapper.put("Windows PV", "Other PV"); - s_mapper.put("Other PV (32-bit)", "Other PV"); - s_mapper.put("Other PV (64-bit)", "Other PV"); + private static final Logger s_logger = Logger + .getLogger(KVMGuestOsMapper.class); + private static Map s_mapper = new HashMap(); + static { + s_mapper.put("CentOS 4.5 (32-bit)", "CentOS 4.5"); + s_mapper.put("CentOS 4.6 (32-bit)", "CentOS 4.6"); + s_mapper.put("CentOS 4.7 (32-bit)", "CentOS 4.7"); + s_mapper.put("CentOS 4.8 (32-bit)", "CentOS 4.8"); + s_mapper.put("CentOS 5.0 (32-bit)", "CentOS 5.0"); + s_mapper.put("CentOS 5.0 (64-bit)", "CentOS 5.0"); + s_mapper.put("CentOS 5.1 (32-bit)", "CentOS 5.1"); + s_mapper.put("CentOS 5.1 (64-bit)", "CentOS 5.1"); + s_mapper.put("CentOS 5.2 (32-bit)", "CentOS 5.2"); + s_mapper.put("CentOS 5.2 (64-bit)", "CentOS 5.2"); + s_mapper.put("CentOS 5.3 (32-bit)", "CentOS 5.3"); + s_mapper.put("CentOS 5.3 (64-bit)", "CentOS 5.3"); + s_mapper.put("CentOS 5.4 (32-bit)", "CentOS 5.4"); + s_mapper.put("CentOS 5.4 (64-bit)", "CentOS 5.4"); + s_mapper.put("CentOS 5.5 (32-bit)", "CentOS 5.5"); + s_mapper.put("CentOS 5.5 (64-bit)", "CentOS 5.5"); + s_mapper.put("Red Hat Enterprise Linux 2", "Red Hat Enterprise Linux 2"); + s_mapper.put("Red Hat Enterprise Linux 3 (32-bit)", + "Red Hat Enterprise Linux 3"); + s_mapper.put("Red Hat Enterprise Linux 3 (64-bit)", + "Red Hat Enterprise Linux 3"); + s_mapper.put("Red Hat Enterprise Linux 4(64-bit)", + "Red Hat Enterprise Linux 4"); + s_mapper.put("Red Hat Enterprise Linux 4.5 (32-bit)", + "Red Hat Enterprise Linux 4.5"); + s_mapper.put("Red Hat Enterprise Linux 4.6 (32-bit)", + "Red Hat Enterprise Linux 4.6"); + s_mapper.put("Red Hat Enterprise Linux 4.7 (32-bit)", + "Red Hat Enterprise Linux 4.7"); + s_mapper.put("Red Hat Enterprise Linux 4.8 (32-bit)", + "Red Hat Enterprise Linux 4.8"); + s_mapper.put("Red Hat Enterprise Linux 5.0 (32-bit)", + "Red Hat Enterprise Linux 5.0"); + s_mapper.put("Red Hat Enterprise Linux 5.0 (64-bit)", + "Red Hat Enterprise Linux 5.0"); + s_mapper.put("Red Hat Enterprise Linux 5.1 (32-bit)", + "Red Hat Enterprise Linux 5.1"); + s_mapper.put("Red Hat Enterprise Linux 5.1 (32-bit)", + "Red Hat Enterprise Linux 5.1"); + s_mapper.put("Red Hat Enterprise Linux 5.2 (32-bit)", + "Red Hat Enterprise Linux 5.2"); + s_mapper.put("Red Hat Enterprise Linux 5.2 (64-bit)", + "Red Hat Enterprise Linux 5.2"); + s_mapper.put("Red Hat Enterprise Linux 5.3 (32-bit)", + "Red Hat Enterprise Linux 5.3"); + s_mapper.put("Red Hat Enterprise Linux 5.3 (64-bit)", + "Red Hat Enterprise Linux 5.3"); + s_mapper.put("Red Hat Enterprise Linux 5.4 (32-bit)", + "Red Hat Enterprise Linux 5.4"); + s_mapper.put("Red Hat Enterprise Linux 5.4 (64-bit)", + "Red Hat Enterprise Linux 5.4"); + s_mapper.put("Red Hat Enterprise Linux 5.5 (32-bit)", + "Red Hat Enterprise Linux 5.5"); + s_mapper.put("Red Hat Enterprise Linux 5.5 (64-bit)", + "Red Hat Enterprise Linux 5.5"); + s_mapper.put("Red Hat Enterprise Linux 6.0 (32-bit)", + "Red Hat Enterprise Linux 6.0"); + s_mapper.put("Red Hat Enterprise Linux 6.0 (64-bit)", + "Red Hat Enterprise Linux 6.0"); + s_mapper.put("Fedora 13", "Fedora 13"); + s_mapper.put("Fedora 12", "Fedora 12"); + s_mapper.put("Fedora 11", "Fedora 11"); + s_mapper.put("Fedora 10", "Fedora 10"); + s_mapper.put("Fedora 9", "Fedora 9"); + s_mapper.put("Fedora 8", "Fedora 8"); + s_mapper.put("Ubuntu 10.04 (32-bit)", "Ubuntu 10.04"); + s_mapper.put("Ubuntu 10.04 (64-bit)", "Ubuntu 10.04"); + s_mapper.put("Ubuntu 10.10 (32-bit)", "Ubuntu 10.10"); + s_mapper.put("Ubuntu 10.10 (64-bit)", "Ubuntu 10.10"); + s_mapper.put("Ubuntu 9.10 (32-bit)", "Ubuntu 9.10"); + s_mapper.put("Ubuntu 9.10 (64-bit)", "Ubuntu 9.10"); + s_mapper.put("Ubuntu 9.04 (32-bit)", "Ubuntu 9.04"); + s_mapper.put("Ubuntu 9.04 (64-bit)", "Ubuntu 9.04"); + s_mapper.put("Ubuntu 8.10 (32-bit)", "Ubuntu 8.10"); + s_mapper.put("Ubuntu 8.10 (64-bit)", "Ubuntu 8.10"); + s_mapper.put("Ubuntu 8.04 (32-bit)", "Other Linux"); + s_mapper.put("Ubuntu 8.04 (64-bit)", "Other Linux"); + s_mapper.put("Debian GNU/Linux 5(32-bit)", "Debian GNU/Linux 5"); + s_mapper.put("Debian GNU/Linux 5(64-bit)", "Debian GNU/Linux 5"); + s_mapper.put("Debian GNU/Linux 4(32-bit)", "Debian GNU/Linux 4"); + s_mapper.put("Debian GNU/Linux 4(64-bit)", "Debian GNU/Linux 4"); + s_mapper.put("Debian GNU/Linux 6(64-bit)", "Debian GNU/Linux 6"); + s_mapper.put("Debian GNU/Linux 6(32-bit)", "Debian GNU/Linux 6"); + s_mapper.put("Other 2.6x Linux (32-bit)", "Other 2.6x Linux"); + s_mapper.put("Other 2.6x Linux (64-bit)", "Other 2.6x Linux"); + s_mapper.put("Other Linux (32-bit)", "Other Linux"); + s_mapper.put("Other Linux (64-bit)", "Other Linux"); + s_mapper.put("Other Ubuntu (32-bit)", "Other Linux"); + s_mapper.put("Other Ubuntu (64-bit)", "Other Linux"); + s_mapper.put("Asianux 3(32-bit)", "Other Linux"); + s_mapper.put("Asianux 3(64-bit)", "Other Linux"); + s_mapper.put("Windows 7 (32-bit)", "Windows 7"); + s_mapper.put("Windows 7 (64-bit)", "Windows 7"); + s_mapper.put("Windows Server 2003 Enterprise Edition(32-bit)", + "Windows Server 2003"); + s_mapper.put("Windows Server 2003 Enterprise Edition(64-bit)", + "Windows Server 2003"); + s_mapper.put("Windows Server 2003 DataCenter Edition(32-bit)", + "Windows Server 2003"); + s_mapper.put("Windows Server 2003 DataCenter Edition(64-bit)", + "Windows Server 2003"); + s_mapper.put("Windows Server 2003 Standard Edition(32-bit)", + "Windows Server 2003"); + s_mapper.put("Windows Server 2003 Standard Edition(64-bit)", + "Windows Server 2003"); + s_mapper.put("Windows Server 2003 Web Edition", "Windows Server 2003"); + s_mapper.put("Microsoft Small Bussiness Server 2003", + "Windows Server 2003"); + s_mapper.put("Windows Server 2008 (32-bit)", "Windows Server 2008"); + s_mapper.put("Windows Server 2008 (64-bit)", "Windows Server 2008"); + s_mapper.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008"); + s_mapper.put("Windows 2000 Server SP4 (32-bit)", "Windows 2000"); + s_mapper.put("Windows 2000 Server", "Windows 2000"); + s_mapper.put("Windows 2000 Advanced Server", "Windows 2000"); + s_mapper.put("Windows 2000 Professional", "Windows 2000"); + s_mapper.put("Windows Vista (32-bit)", "Windows Vista"); + s_mapper.put("Windows Vista (64-bit)", "Windows Vista"); + s_mapper.put("Windows XP SP2 (32-bit)", "Windows XP"); + s_mapper.put("Windows XP SP3 (32-bit)", "Windows XP"); + s_mapper.put("Windows XP (32-bit)", "Windows XP"); + s_mapper.put("Windows XP (64-bit)", "Windows XP"); + s_mapper.put("Windows 98", "Windows 98"); + s_mapper.put("Windows 95", "Windows 95"); + s_mapper.put("Windows NT 4", "Windows NT"); + s_mapper.put("Windows 3.1", "Windows 3.1"); + s_mapper.put("Windows PV", "Other PV"); + s_mapper.put("Other PV (32-bit)", "Other PV"); + s_mapper.put("Other PV (64-bit)", "Other PV"); - } + } - public static String getGuestOsName(String guestOsName) { - String guestOS = s_mapper.get(guestOsName); - if (guestOS == null) { - s_logger.debug("Can't find the mapping of guest os: " + guestOsName); - return "Other"; - } else { - return guestOS; - } - } + public static String getGuestOsName(String guestOsName) { + String guestOS = s_mapper.get(guestOsName); + if (guestOS == null) { + s_logger.debug("Can't find the mapping of guest os: " + guestOsName); + return "Other"; + } else { + return guestOS; + } + } } diff --git a/agent/src/com/cloud/agent/resource/computing/KVMHABase.java b/agent/src/com/cloud/agent/resource/computing/KVMHABase.java index 0377efcc874..ed29a627468 100644 --- a/agent/src/com/cloud/agent/resource/computing/KVMHABase.java +++ b/agent/src/com/cloud/agent/resource/computing/KVMHABase.java @@ -34,187 +34,187 @@ import com.cloud.utils.script.OutputInterpreter.AllLinesParser; import com.cloud.utils.script.Script; public class KVMHABase { - private long _timeout = 60000; /* 1 minutes */ - protected static String _heartBeatPath; - protected long _heartBeatUpdateTimeout = 60000; - protected long _heartBeatUpdateFreq = 60000; - protected long _heartBeatUpdateMaxRetry = 3; + private long _timeout = 60000; /* 1 minutes */ + protected static String _heartBeatPath; + protected long _heartBeatUpdateTimeout = 60000; + protected long _heartBeatUpdateFreq = 60000; + protected long _heartBeatUpdateMaxRetry = 3; - public static enum PoolType { - PrimaryStorage, SecondaryStorage - } + public static enum PoolType { + PrimaryStorage, SecondaryStorage + } - public static class NfsStoragePool { - String _poolUUID; - String _poolIp; - String _poolMountSourcePath; - String _mountDestPath; - PoolType _type; + public static class NfsStoragePool { + String _poolUUID; + String _poolIp; + String _poolMountSourcePath; + String _mountDestPath; + PoolType _type; - public NfsStoragePool(String poolUUID, String poolIp, - String poolSourcePath, String mountDestPath, PoolType type) { - this._poolUUID = poolUUID; - this._poolIp = poolIp; - this._poolMountSourcePath = poolSourcePath; - this._mountDestPath = mountDestPath; - this._type = type; - } - } + public NfsStoragePool(String poolUUID, String poolIp, + String poolSourcePath, String mountDestPath, PoolType type) { + this._poolUUID = poolUUID; + this._poolIp = poolIp; + this._poolMountSourcePath = poolSourcePath; + this._mountDestPath = mountDestPath; + this._type = type; + } + } - protected String checkingMountPoint(NfsStoragePool pool, String poolName) { - String mountSource = pool._poolIp + ":" + pool._poolMountSourcePath; - String mountPaths = Script - .runSimpleBashScript("cat /proc/mounts | grep " + mountSource); - String destPath = pool._mountDestPath; + protected String checkingMountPoint(NfsStoragePool pool, String poolName) { + String mountSource = pool._poolIp + ":" + pool._poolMountSourcePath; + String mountPaths = Script + .runSimpleBashScript("cat /proc/mounts | grep " + mountSource); + String destPath = pool._mountDestPath; - if (mountPaths != null) { - String token[] = mountPaths.split(" "); - String mountType = token[2]; - String mountDestPath = token[1]; - if (mountType.equalsIgnoreCase("nfs")) { - if (poolName != null && !mountDestPath.startsWith(destPath)) { - /* we need to mount it under poolName */ - Script mount = new Script("/bin/bash", 60000); - mount.add("-c"); - mount.add("mount " + mountSource + " " + destPath); - String result = mount.execute(); - if (result != null) { - destPath = null; - } - destroyVMs(destPath); - } else if (poolName == null) { - destPath = mountDestPath; - } - } - } else { - /* Can't find the mount point? */ - /* we need to mount it under poolName */ - if (poolName != null) { - Script mount = new Script("/bin/bash", 60000); - mount.add("-c"); - mount.add("mount " + mountSource + " " + destPath); - String result = mount.execute(); - if (result != null) { - destPath = null; - } + if (mountPaths != null) { + String token[] = mountPaths.split(" "); + String mountType = token[2]; + String mountDestPath = token[1]; + if (mountType.equalsIgnoreCase("nfs")) { + if (poolName != null && !mountDestPath.startsWith(destPath)) { + /* we need to mount it under poolName */ + Script mount = new Script("/bin/bash", 60000); + mount.add("-c"); + mount.add("mount " + mountSource + " " + destPath); + String result = mount.execute(); + if (result != null) { + destPath = null; + } + destroyVMs(destPath); + } else if (poolName == null) { + destPath = mountDestPath; + } + } + } else { + /* Can't find the mount point? */ + /* we need to mount it under poolName */ + if (poolName != null) { + Script mount = new Script("/bin/bash", 60000); + mount.add("-c"); + mount.add("mount " + mountSource + " " + destPath); + String result = mount.execute(); + if (result != null) { + destPath = null; + } - destroyVMs(destPath); - } - } + destroyVMs(destPath); + } + } - return destPath; - } + return destPath; + } - protected String getMountPoint(NfsStoragePool storagePool) { + protected String getMountPoint(NfsStoragePool storagePool) { - StoragePool pool = null; - String poolName = null; - try { - pool = LibvirtConnection.getConnection() - .storagePoolLookupByUUIDString(storagePool._poolUUID); - if (pool != null) { - StoragePoolInfo spi = pool.getInfo(); - if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { - pool.create(0); - } else { - /* - * Sometimes, the mount point is lost, even libvirt thinks - * the storage pool still running - */ - } - } - poolName = pool.getName(); - } catch (LibvirtException e) { + StoragePool pool = null; + String poolName = null; + try { + pool = LibvirtConnection.getConnection() + .storagePoolLookupByUUIDString(storagePool._poolUUID); + if (pool != null) { + StoragePoolInfo spi = pool.getInfo(); + if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + pool.create(0); + } else { + /* + * Sometimes, the mount point is lost, even libvirt thinks + * the storage pool still running + */ + } + } + poolName = pool.getName(); + } catch (LibvirtException e) { - } finally { - try { - if (pool != null) { - pool.free(); - } - } catch (LibvirtException e) { + } finally { + try { + if (pool != null) { + pool.free(); + } + } catch (LibvirtException e) { - } - } + } + } - return checkingMountPoint(storagePool, poolName); - } + return checkingMountPoint(storagePool, poolName); + } - protected void destroyVMs(String mountPath) { - /* if there are VMs using disks under this mount path, destroy them */ - Script cmd = new Script("/bin/bash", _timeout); - cmd.add("-c"); - cmd.add("ps axu|grep qemu|grep " + mountPath + "* |awk '{print $2}'"); - AllLinesParser parser = new OutputInterpreter.AllLinesParser(); - String result = cmd.execute(parser); + protected void destroyVMs(String mountPath) { + /* if there are VMs using disks under this mount path, destroy them */ + Script cmd = new Script("/bin/bash", _timeout); + cmd.add("-c"); + cmd.add("ps axu|grep qemu|grep " + mountPath + "* |awk '{print $2}'"); + AllLinesParser parser = new OutputInterpreter.AllLinesParser(); + String result = cmd.execute(parser); - if (result != null) { - return; - } + if (result != null) { + return; + } - String pids[] = parser.getLines().split("\n"); - for (String pid : pids) { - Script.runSimpleBashScript("kill -9 " + pid); - } - } + String pids[] = parser.getLines().split("\n"); + for (String pid : pids) { + Script.runSimpleBashScript("kill -9 " + pid); + } + } - protected String getHBFile(String mountPoint, String hostIP) { - return mountPoint + File.separator + "KVMHA" + File.separator + "hb-" - + hostIP; - } + protected String getHBFile(String mountPoint, String hostIP) { + return mountPoint + File.separator + "KVMHA" + File.separator + "hb-" + + hostIP; + } - protected String getHBFolder(String mountPoint) { - return mountPoint + File.separator + "KVMHA" + File.separator; - } + protected String getHBFolder(String mountPoint) { + return mountPoint + File.separator + "KVMHA" + File.separator; + } - protected String runScriptRetry(String cmdString, - OutputInterpreter interpreter) { - String result = null; - for (int i = 0; i < 3; i++) { - Script cmd = new Script("/bin/bash", _timeout); - cmd.add("-c"); - cmd.add(cmdString); - if (interpreter != null) - result = cmd.execute(interpreter); - else { - result = cmd.execute(); - } - if (result == Script.ERR_TIMEOUT) { - continue; - } else if (result == null) { - break; - } - } + protected String runScriptRetry(String cmdString, + OutputInterpreter interpreter) { + String result = null; + for (int i = 0; i < 3; i++) { + Script cmd = new Script("/bin/bash", _timeout); + cmd.add("-c"); + cmd.add(cmdString); + if (interpreter != null) + result = cmd.execute(interpreter); + else { + result = cmd.execute(); + } + if (result == Script.ERR_TIMEOUT) { + continue; + } else if (result == null) { + break; + } + } - return result; - } + return result; + } - public static void main(String[] args) { + public static void main(String[] args) { - NfsStoragePool pool = new KVMHAMonitor.NfsStoragePool(null, null, null, - null, PoolType.PrimaryStorage); + NfsStoragePool pool = new KVMHAMonitor.NfsStoragePool(null, null, null, + null, PoolType.PrimaryStorage); - KVMHAMonitor haWritter = new KVMHAMonitor(pool, "192.168.1.163", null); - Thread ha = new Thread(haWritter); - ha.start(); + KVMHAMonitor haWritter = new KVMHAMonitor(pool, "192.168.1.163", null); + Thread ha = new Thread(haWritter); + ha.start(); - KVMHAChecker haChecker = new KVMHAChecker(haWritter.getStoragePools(), - "192.168.1.163"); + KVMHAChecker haChecker = new KVMHAChecker(haWritter.getStoragePools(), + "192.168.1.163"); - ExecutorService exe = Executors.newFixedThreadPool(1); - Future future = exe.submit((Callable) haChecker); - try { - for (int i = 0; i < 10; i++) { - System.out.println(future.get()); - future = exe.submit((Callable) haChecker); - } - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ExecutionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + ExecutorService exe = Executors.newFixedThreadPool(1); + Future future = exe.submit((Callable) haChecker); + try { + for (int i = 0; i < 10; i++) { + System.out.println(future.get()); + future = exe.submit((Callable) haChecker); + } + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ExecutionException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } - } + } } diff --git a/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java b/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java index d9b4692ef83..b2df8c1736a 100644 --- a/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java +++ b/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java @@ -27,59 +27,59 @@ import com.cloud.utils.script.OutputInterpreter; import com.cloud.utils.script.Script; public class KVMHAChecker extends KVMHABase implements Callable { - private static final Logger s_logger = Logger.getLogger(KVMHAChecker.class); - private List _pools; - private String _hostIP; - private long _heartBeatCheckerTimeout = 360000; /* 6 minutes */ + private static final Logger s_logger = Logger.getLogger(KVMHAChecker.class); + private List _pools; + private String _hostIP; + private long _heartBeatCheckerTimeout = 360000; /* 6 minutes */ - public KVMHAChecker(List pools, String host) { - this._pools = pools; - this._hostIP = host; - } + public KVMHAChecker(List pools, String host) { + this._pools = pools; + this._hostIP = host; + } - /* - * True means heartbeaing is on going, or we can't get it's status. False - * means heartbeating is stopped definitely - */ - private Boolean checkingHB() { - List results = new ArrayList(); - for (NfsStoragePool pool : _pools) { + /* + * True means heartbeaing is on going, or we can't get it's status. False + * means heartbeating is stopped definitely + */ + private Boolean checkingHB() { + List results = new ArrayList(); + for (NfsStoragePool pool : _pools) { - Script cmd = new Script(_heartBeatPath, _heartBeatCheckerTimeout, - s_logger); - cmd.add("-i", pool._poolIp); - cmd.add("-p", pool._poolMountSourcePath); - cmd.add("-m", pool._mountDestPath); - cmd.add("-h", _hostIP); - cmd.add("-r"); - cmd.add("-t", - String.valueOf((_heartBeatUpdateFreq + _heartBeatUpdateTimeout) / 1000 * 2)); - OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); - String result = cmd.execute(parser); - s_logger.debug("pool: " + pool._poolIp); - s_logger.debug("reture: " + result); - s_logger.debug("parser: " + parser.getLine()); - if (result == null && parser.getLine().contains("> DEAD <")) { - s_logger.debug("read heartbeat failed: " + result); - results.add(false); - } else { - results.add(true); - } - } + Script cmd = new Script(_heartBeatPath, _heartBeatCheckerTimeout, + s_logger); + cmd.add("-i", pool._poolIp); + cmd.add("-p", pool._poolMountSourcePath); + cmd.add("-m", pool._mountDestPath); + cmd.add("-h", _hostIP); + cmd.add("-r"); + cmd.add("-t", + String.valueOf((_heartBeatUpdateFreq + _heartBeatUpdateTimeout) / 1000 * 2)); + OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); + String result = cmd.execute(parser); + s_logger.debug("pool: " + pool._poolIp); + s_logger.debug("reture: " + result); + s_logger.debug("parser: " + parser.getLine()); + if (result == null && parser.getLine().contains("> DEAD <")) { + s_logger.debug("read heartbeat failed: " + result); + results.add(false); + } else { + results.add(true); + } + } - for (Boolean r : results) { - if (r) { - return true; - } - } + for (Boolean r : results) { + if (r) { + return true; + } + } - return false; - } + return false; + } - @Override - public Boolean call() throws Exception { - // s_logger.addAppender(new org.apache.log4j.ConsoleAppender(new - // org.apache.log4j.PatternLayout(), "System.out")); - return checkingHB(); - } + @Override + public Boolean call() throws Exception { + // s_logger.addAppender(new org.apache.log4j.ConsoleAppender(new + // org.apache.log4j.PatternLayout(), "System.out")); + return checkingHB(); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/KVMHAMonitor.java b/agent/src/com/cloud/agent/resource/computing/KVMHAMonitor.java index 42f1a6bddf1..09d5c83928f 100644 --- a/agent/src/com/cloud/agent/resource/computing/KVMHAMonitor.java +++ b/agent/src/com/cloud/agent/resource/computing/KVMHAMonitor.java @@ -24,96 +24,96 @@ import org.apache.log4j.Logger; import com.cloud.utils.script.Script; public class KVMHAMonitor extends KVMHABase implements Runnable { - private static final Logger s_logger = Logger.getLogger(KVMHAMonitor.class); - private Map _storagePool = new ConcurrentHashMap(); + private static final Logger s_logger = Logger.getLogger(KVMHAMonitor.class); + private Map _storagePool = new ConcurrentHashMap(); - private String _hostIP; /* private ip address */ + private String _hostIP; /* private ip address */ - public KVMHAMonitor(NfsStoragePool pool, String host, String scriptPath) { - if (pool != null) { - this._storagePool.put(pool._poolUUID, pool); - } - this._hostIP = host; - this._heartBeatPath = scriptPath; - } + public KVMHAMonitor(NfsStoragePool pool, String host, String scriptPath) { + if (pool != null) { + this._storagePool.put(pool._poolUUID, pool); + } + this._hostIP = host; + this._heartBeatPath = scriptPath; + } - public void addStoragePool(NfsStoragePool pool) { - synchronized (_storagePool) { - this._storagePool.put(pool._poolUUID, pool); - } - } + public void addStoragePool(NfsStoragePool pool) { + synchronized (_storagePool) { + this._storagePool.put(pool._poolUUID, pool); + } + } - public void removeStoragePool(String uuid) { - synchronized (_storagePool) { - this._storagePool.remove(uuid); - } - } + public void removeStoragePool(String uuid) { + synchronized (_storagePool) { + this._storagePool.remove(uuid); + } + } - public List getStoragePools() { - synchronized (_storagePool) { - return new ArrayList(_storagePool.values()); - } - } + public List getStoragePools() { + synchronized (_storagePool) { + return new ArrayList(_storagePool.values()); + } + } - private class Monitor implements Runnable { + private class Monitor implements Runnable { - @Override - public void run() { - synchronized (_storagePool) { - for (NfsStoragePool primaryStoragePool : _storagePool.values()) { - String result = null; - for (int i = 0; i < 5; i++) { - Script cmd = new Script(_heartBeatPath, - _heartBeatUpdateTimeout, s_logger); - cmd.add("-i", primaryStoragePool._poolIp); - cmd.add("-p", primaryStoragePool._poolMountSourcePath); - cmd.add("-m", primaryStoragePool._mountDestPath); - cmd.add("-h", _hostIP); - result = cmd.execute(); - if (result != null) { - s_logger.warn("write heartbeat failed: " + result - + ", retry: " + i); - } else { - break; - } - } + @Override + public void run() { + synchronized (_storagePool) { + for (NfsStoragePool primaryStoragePool : _storagePool.values()) { + String result = null; + for (int i = 0; i < 5; i++) { + Script cmd = new Script(_heartBeatPath, + _heartBeatUpdateTimeout, s_logger); + cmd.add("-i", primaryStoragePool._poolIp); + cmd.add("-p", primaryStoragePool._poolMountSourcePath); + cmd.add("-m", primaryStoragePool._mountDestPath); + cmd.add("-h", _hostIP); + result = cmd.execute(); + if (result != null) { + s_logger.warn("write heartbeat failed: " + result + + ", retry: " + i); + } else { + break; + } + } - if (result != null) { - s_logger.warn("write heartbeat failed: " + result - + "; reboot the host"); - Script cmd = new Script(_heartBeatPath, - _heartBeatUpdateTimeout, s_logger); - cmd.add("-i", primaryStoragePool._poolIp); - cmd.add("-p", primaryStoragePool._poolMountSourcePath); - cmd.add("-m", primaryStoragePool._mountDestPath); - cmd.add("-c"); - result = cmd.execute(); - } - } - } + if (result != null) { + s_logger.warn("write heartbeat failed: " + result + + "; reboot the host"); + Script cmd = new Script(_heartBeatPath, + _heartBeatUpdateTimeout, s_logger); + cmd.add("-i", primaryStoragePool._poolIp); + cmd.add("-p", primaryStoragePool._poolMountSourcePath); + cmd.add("-m", primaryStoragePool._mountDestPath); + cmd.add("-c"); + result = cmd.execute(); + } + } + } - } - } + } + } - @Override - public void run() { - // s_logger.addAppender(new org.apache.log4j.ConsoleAppender(new - // org.apache.log4j.PatternLayout(), "System.out")); - while (true) { - Thread monitorThread = new Thread(new Monitor()); - monitorThread.start(); - try { - monitorThread.join(); - } catch (InterruptedException e) { + @Override + public void run() { + // s_logger.addAppender(new org.apache.log4j.ConsoleAppender(new + // org.apache.log4j.PatternLayout(), "System.out")); + while (true) { + Thread monitorThread = new Thread(new Monitor()); + monitorThread.start(); + try { + monitorThread.join(); + } catch (InterruptedException e) { - } + } - try { - Thread.sleep(_heartBeatUpdateFreq); - } catch (InterruptedException e) { + try { + Thread.sleep(_heartBeatUpdateFreq); + } catch (InterruptedException e) { - } - } - } + } + } + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtCapXMLParser.java b/agent/src/com/cloud/agent/resource/computing/LibvirtCapXMLParser.java index 9e2e496978a..4c5fa29485c 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtCapXMLParser.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtCapXMLParser.java @@ -30,165 +30,165 @@ import org.xml.sax.SAXException; * */ public class LibvirtCapXMLParser extends LibvirtXMLParser { - private boolean _host = false; - private boolean _guest = false; - private boolean _osType = false; - private boolean _domainTypeKVM = false; - private boolean _emulatorFlag = false; - private final StringBuffer _emulator = new StringBuffer(); - private final StringBuffer _capXML = new StringBuffer(); - private static final Logger s_logger = Logger - .getLogger(LibvirtCapXMLParser.class); - private final ArrayList guestOsTypes = new ArrayList(); + private boolean _host = false; + private boolean _guest = false; + private boolean _osType = false; + private boolean _domainTypeKVM = false; + private boolean _emulatorFlag = false; + private final StringBuffer _emulator = new StringBuffer(); + private final StringBuffer _capXML = new StringBuffer(); + private static final Logger s_logger = Logger + .getLogger(LibvirtCapXMLParser.class); + private final ArrayList guestOsTypes = new ArrayList(); - @Override - public void endElement(String uri, String localName, String qName) - throws SAXException { - if (qName.equalsIgnoreCase("host")) { - _host = false; - } else if (qName.equalsIgnoreCase("os_type")) { - _osType = false; - } else if (qName.equalsIgnoreCase("guest")) { - _guest = false; - } else if (qName.equalsIgnoreCase("domain")) { - _domainTypeKVM = false; - } else if (qName.equalsIgnoreCase("emulator")) { - _emulatorFlag = false; + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + if (qName.equalsIgnoreCase("host")) { + _host = false; + } else if (qName.equalsIgnoreCase("os_type")) { + _osType = false; + } else if (qName.equalsIgnoreCase("guest")) { + _guest = false; + } else if (qName.equalsIgnoreCase("domain")) { + _domainTypeKVM = false; + } else if (qName.equalsIgnoreCase("emulator")) { + _emulatorFlag = false; - } else if (_host) { - _capXML.append("<").append("/").append(qName).append(">"); - } - } + } else if (_host) { + _capXML.append("<").append("/").append(qName).append(">"); + } + } - @Override - public void characters(char[] ch, int start, int length) - throws SAXException { - if (_host) { - _capXML.append(ch, start, length); - } else if (_osType) { - guestOsTypes.add(new String(ch, start, length)); - } else if (_emulatorFlag) { - _emulator.append(ch, start, length); - } - } + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (_host) { + _capXML.append(ch, start, length); + } else if (_osType) { + guestOsTypes.add(new String(ch, start, length)); + } else if (_emulatorFlag) { + _emulator.append(ch, start, length); + } + } - @Override - public void startElement(String uri, String localName, String qName, - Attributes attributes) throws SAXException { - if (qName.equalsIgnoreCase("host")) { - _host = true; - } else if (qName.equalsIgnoreCase("guest")) { - _guest = true; - } else if (qName.equalsIgnoreCase("os_type")) { - if (_guest) { - _osType = true; - } - } else if (qName.equalsIgnoreCase("domain")) { - for (int i = 0; i < attributes.getLength(); i++) { - if (attributes.getQName(i).equalsIgnoreCase("type") - && attributes.getValue(i).equalsIgnoreCase("kvm")) { - _domainTypeKVM = true; - } - } - } else if (qName.equalsIgnoreCase("emulator") && _domainTypeKVM) { - _emulatorFlag = true; - _emulator.delete(0, _emulator.length()); - } else if (_host) { - _capXML.append("<").append(qName); - for (int i = 0; i < attributes.getLength(); i++) { - _capXML.append(" ").append(attributes.getQName(i)).append("=") - .append(attributes.getValue(i)); - } - _capXML.append(">"); - } + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + if (qName.equalsIgnoreCase("host")) { + _host = true; + } else if (qName.equalsIgnoreCase("guest")) { + _guest = true; + } else if (qName.equalsIgnoreCase("os_type")) { + if (_guest) { + _osType = true; + } + } else if (qName.equalsIgnoreCase("domain")) { + for (int i = 0; i < attributes.getLength(); i++) { + if (attributes.getQName(i).equalsIgnoreCase("type") + && attributes.getValue(i).equalsIgnoreCase("kvm")) { + _domainTypeKVM = true; + } + } + } else if (qName.equalsIgnoreCase("emulator") && _domainTypeKVM) { + _emulatorFlag = true; + _emulator.delete(0, _emulator.length()); + } else if (_host) { + _capXML.append("<").append(qName); + for (int i = 0; i < attributes.getLength(); i++) { + _capXML.append(" ").append(attributes.getQName(i)).append("=") + .append(attributes.getValue(i)); + } + _capXML.append(">"); + } - } + } - public String parseCapabilitiesXML(String capXML) { - if (!_initialized) { - return null; - } - try { - _sp.parse(new InputSource(new StringReader(capXML)), this); - return _capXML.toString(); - } catch (SAXException se) { - s_logger.warn(se.getMessage()); - } catch (IOException ie) { - s_logger.error(ie.getMessage()); - } - return null; - } + public String parseCapabilitiesXML(String capXML) { + if (!_initialized) { + return null; + } + try { + _sp.parse(new InputSource(new StringReader(capXML)), this); + return _capXML.toString(); + } catch (SAXException se) { + s_logger.warn(se.getMessage()); + } catch (IOException ie) { + s_logger.error(ie.getMessage()); + } + return null; + } - public ArrayList getGuestOsType() { - return guestOsTypes; - } + public ArrayList getGuestOsType() { + return guestOsTypes; + } - public String getEmulator() { - return _emulator.toString(); - } + public String getEmulator() { + return _emulator.toString(); + } - public static void main(String[] args) { - String capXML = "" + " " + " " - + " x86_64" + " core2duo" - + " " - + " " - + " " - + " " - + " " + " " - + " " - + " " - + " " + " " - + " " + " " - + " " + " " - + " " + " " + " " - + " " - + " tcp" - + " " + " " - + " " + " " - + " " + " " - + " " + " " - + " " + " " + " " - + " " + " " + "" + " " - + " hvm" + " " - + " 32" - + " /usr/bin/qemu" - + " pc-0.11" - + " pc" - + " pc-0.10" - + " isapc" - + " " + " " - + " " - + " /usr/bin/qemu-kvm" - + " pc-0.11" - + " pc" - + " pc-0.10" - + " isapc" + " " - + " " + " " + " " - + " " + " " - + " " - + " " + " " - + " " + " " + " hvm" - + " " + " 64" - + " /usr/bin/qemu-system-x86_64" - + " pc-0.11" - + " pc" - + " pc-0.10" - + " isapc" - + " " + " " - + " " - + " /usr/bin/qemu-kvm" - + " pc-0.11" - + " pc" - + " pc-0.10" - + " isapc" + " " - + " " + " " + " " - + " " - + " " + " " - + " " + ""; + public static void main(String[] args) { + String capXML = "" + " " + " " + + " x86_64" + " core2duo" + + " " + + " " + + " " + + " " + + " " + " " + + " " + + " " + + " " + " " + + " " + " " + + " " + " " + + " " + " " + " " + + " " + + " tcp" + + " " + " " + + " " + " " + + " " + " " + + " " + " " + + " " + " " + " " + + " " + " " + "" + " " + + " hvm" + " " + + " 32" + + " /usr/bin/qemu" + + " pc-0.11" + + " pc" + + " pc-0.10" + + " isapc" + + " " + " " + + " " + + " /usr/bin/qemu-kvm" + + " pc-0.11" + + " pc" + + " pc-0.10" + + " isapc" + " " + + " " + " " + " " + + " " + " " + + " " + + " " + " " + + " " + " " + " hvm" + + " " + " 64" + + " /usr/bin/qemu-system-x86_64" + + " pc-0.11" + + " pc" + + " pc-0.10" + + " isapc" + + " " + " " + + " " + + " /usr/bin/qemu-kvm" + + " pc-0.11" + + " pc" + + " pc-0.10" + + " isapc" + " " + + " " + " " + " " + + " " + + " " + " " + + " " + ""; - LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); - String cap = parser.parseCapabilitiesXML(capXML); - System.out.println(parser.getGuestOsType()); - System.out.println(parser.getEmulator()); - } + LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); + String cap = parser.parseCapabilitiesXML(capXML); + System.out.println(parser.getGuestOsType()); + System.out.println(parser.getEmulator()); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java b/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java index 61d8b6a28b9..112ab61e50b 100755 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java @@ -227,3873 +227,3861 @@ import com.cloud.vm.VirtualMachineName; **/ @Local(value = { ServerResource.class }) public class LibvirtComputingResource extends ServerResourceBase implements - ServerResource { - private static final Logger s_logger = Logger - .getLogger(LibvirtComputingResource.class); - - private String _modifyVlanPath; - private String _versionstringpath; - private String _patchdomrPath; - private String _createvmPath; - private String _manageSnapshotPath; - private String _createTmplPath; - private String _heartBeatPath; - private String _securityGroupPath; - private String _networkUsagePath; - private String _host; - private String _dcId; - private String _pod; - private String _clusterId; - private int _migrateSpeed; - - private long _hvVersion; - private KVMHAMonitor _monitor; - private final String _SSHKEYSPATH = "/root/.ssh"; - private final String _SSHPRVKEYPATH = _SSHKEYSPATH + File.separator - + "id_rsa.cloud"; - private final String _SSHPUBKEYPATH = _SSHKEYSPATH + File.separator - + "id_rsa.pub.cloud"; - private String _mountPoint = "/mnt"; - StorageLayer _storage; - private KVMStoragePoolManager _storagePoolMgr; - - private static final class KeyValueInterpreter extends OutputInterpreter { - private final Map map = new HashMap(); - - @Override - public String interpret(BufferedReader reader) throws IOException { - String line = null; - int numLines = 0; - while ((line = reader.readLine()) != null) { - String[] toks = line.trim().split("="); - if (toks.length < 2) { - s_logger.warn("Failed to parse Script output: " + line); - } else { - map.put(toks[0].trim(), toks[1].trim()); - } - numLines++; - } - if (numLines == 0) { - s_logger.warn("KeyValueInterpreter: no output lines?"); - } - return null; - } - - public Map getKeyValues() { - return map; - } - } - - @Override - protected String getDefaultScriptsDir() { - return null; - } - - protected static MessageFormat SnapshotXML = new MessageFormat( - " " + " {0}" + " " - + " {1}" + " " - + " "); - - protected String _hypervisorType; - protected String _hypervisorURI; - protected String _hypervisorPath; - protected String _sysvmISOPath; - protected String _privNwName; - protected String _privBridgeName; - protected String _linkLocalBridgeName; - protected String _publicBridgeName; - protected String _guestBridgeName; - protected String _privateIp; - protected String _pool; - protected String _localGateway; - private boolean _can_bridge_firewall; - protected String _localStoragePath; - protected String _localStorageUUID; - private Pair _pifs; - private final Map _vmStats = new ConcurrentHashMap(); - - protected boolean _disconnected = true; - protected int _timeout; - protected int _cmdsTimeout; - protected int _stopTimeout; - protected static HashMap s_statesTable; - static { - s_statesTable = new HashMap(); - s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, - State.Stopped); - s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_PAUSED, - State.Running); - s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_RUNNING, - State.Running); - s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_BLOCKED, - State.Running); - s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_NOSTATE, - State.Unknown); - s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTDOWN, - State.Stopping); - } - - protected HashMap _vms = new HashMap(20); - protected List _vmsKilled = new ArrayList(); - - private VirtualRoutingResource _virtRouterResource; - - private String _pingTestPath; - - private int _dom0MinMem; - - protected enum defineOps { - UNDEFINE_VM, DEFINE_VM - } - - private String getEndIpFromStartIp(String startIp, int numIps) { - String[] tokens = startIp.split("[.]"); - assert (tokens.length == 4); - int lastbyte = Integer.parseInt(tokens[3]); - lastbyte = lastbyte + numIps; - tokens[3] = Integer.toString(lastbyte); - StringBuilder end = new StringBuilder(15); - end.append(tokens[0]).append(".").append(tokens[1]).append(".") - .append(tokens[2]).append(".").append(tokens[3]); - return end.toString(); - } - - private Map getDeveloperProperties() - throws ConfigurationException { - final File file = PropertiesUtil.findConfigFile("developer.properties"); - if (file == null) { - throw new ConfigurationException( - "Unable to find developer.properties."); - } - - s_logger.info("developer.properties found at " + file.getAbsolutePath()); - Properties properties = new Properties(); - try { - properties.load(new FileInputStream(file)); - - String startMac = (String) properties.get("private.macaddr.start"); - if (startMac == null) { - throw new ConfigurationException( - "Developers must specify start mac for private ip range"); - } - - String startIp = (String) properties.get("private.ipaddr.start"); - if (startIp == null) { - throw new ConfigurationException( - "Developers must specify start ip for private ip range"); - } - final Map params = PropertiesUtil.toMap(properties); - - String endIp = (String) properties.get("private.ipaddr.end"); - if (endIp == null) { - endIp = getEndIpFromStartIp(startIp, 16); - params.put("private.ipaddr.end", endIp); - } - return params; - } catch (final FileNotFoundException ex) { - throw new CloudRuntimeException("Cannot find the file: " - + file.getAbsolutePath(), ex); - } catch (final IOException ex) { - throw new CloudRuntimeException("IOException in reading " - + file.getAbsolutePath(), ex); - } - } - - protected String getDefaultNetworkScriptsDir() { - return "scripts/vm/network/vnet"; - } - - protected String getDefaultStorageScriptsDir() { - return "scripts/storage/qcow2"; - } - - private void saveProperties(Map params) - throws ConfigurationException { - final File file = PropertiesUtil.findConfigFile("agent.properties"); - if (file == null) { - throw new ConfigurationException("Unable to find agent.properties."); - } - - s_logger.info("agent.properties found at " + file.getAbsolutePath()); - - try { - Properties _properties = new Properties(); - _properties.load(new FileInputStream(file)); - Set names = _properties.stringPropertyNames(); - for (String key : params.keySet()) { - if (!names.contains(key)) { - _properties.setProperty(key, (String) params.get(key)); - } - } - _properties.store(new FileOutputStream(file), ""); - } catch (final FileNotFoundException ex) { - throw new CloudRuntimeException("Cannot find the file: " - + file.getAbsolutePath(), ex); - } catch (final IOException ex) { - throw new CloudRuntimeException("IOException in reading " - + file.getAbsolutePath(), ex); - } - } - - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - boolean success = super.configure(name, params); - if (!success) { - return false; - } - - try { - Class clazz = Class - .forName("com.cloud.storage.JavaStorageLayer"); - _storage = (StorageLayer) ComponentLocator.inject(clazz); - _storage.configure("StorageLayer", params); - } catch (ClassNotFoundException e) { - throw new ConfigurationException("Unable to find class " - + "com.cloud.storage.JavaStorageLayer"); - } - - _virtRouterResource = new VirtualRoutingResource(); - - // Set the domr scripts directory - params.put("domr.scripts.dir", "scripts/network/domr/kvm"); - - success = _virtRouterResource.configure(name, params); - - String kvmScriptsDir = (String) params.get("kvm.scripts.dir"); - if (kvmScriptsDir == null) { - kvmScriptsDir = "scripts/vm/hypervisor/kvm"; - } - - String networkScriptsDir = (String) params.get("network.scripts.dir"); - if (networkScriptsDir == null) { - networkScriptsDir = getDefaultNetworkScriptsDir(); - } - - String storageScriptsDir = (String) params.get("storage.scripts.dir"); - if (storageScriptsDir == null) { - storageScriptsDir = getDefaultStorageScriptsDir(); - } - - if (!success) { - return false; - } - - _host = (String) params.get("host"); - if (_host == null) { - _host = "localhost"; - } - - _dcId = (String) params.get("zone"); - if (_dcId == null) { - _dcId = "default"; - } - - _pod = (String) params.get("pod"); - if (_pod == null) { - _pod = "default"; - } - - _clusterId = (String) params.get("cluster"); - - _modifyVlanPath = Script.findScript(networkScriptsDir, "modifyvlan.sh"); - if (_modifyVlanPath == null) { - throw new ConfigurationException("Unable to find modifyvlan.sh"); - } - - _versionstringpath = Script.findScript(kvmScriptsDir, "versions.sh"); - if (_versionstringpath == null) { - throw new ConfigurationException("Unable to find versions.sh"); - } - - _patchdomrPath = Script.findScript(kvmScriptsDir + "/patch/", - "rundomrpre.sh"); - if (_patchdomrPath == null) { - throw new ConfigurationException("Unable to find rundomrpre.sh"); - } - - _heartBeatPath = Script.findScript(kvmScriptsDir, "kvmheartbeat.sh"); - if (_heartBeatPath == null) { - throw new ConfigurationException("Unable to find kvmheartbeat.sh"); - } - - _createvmPath = Script.findScript(storageScriptsDir, "createvm.sh"); - if (_createvmPath == null) { - throw new ConfigurationException("Unable to find the createvm.sh"); - } - - _manageSnapshotPath = Script.findScript(storageScriptsDir, - "managesnapshot.sh"); - if (_manageSnapshotPath == null) { - throw new ConfigurationException( - "Unable to find the managesnapshot.sh"); - } - - _createTmplPath = Script - .findScript(storageScriptsDir, "createtmplt.sh"); - if (_createTmplPath == null) { - throw new ConfigurationException( - "Unable to find the createtmplt.sh"); - } - - _securityGroupPath = Script.findScript(networkScriptsDir, - "security_group.py"); - if (_securityGroupPath == null) { - throw new ConfigurationException( - "Unable to find the security_group.py"); - } - - _networkUsagePath = Script.findScript("scripts/network/domr/", - "networkUsage.sh"); - if (_networkUsagePath == null) { - throw new ConfigurationException( - "Unable to find the networkUsage.sh"); - } - - String value = (String) params.get("developer"); - boolean isDeveloper = Boolean.parseBoolean(value); - - if (isDeveloper) { - params.putAll(getDeveloperProperties()); - } - - _pool = (String) params.get("pool"); - if (_pool == null) { - _pool = "/root"; - } - - String instance = (String) params.get("instance"); - - _hypervisorType = (String) params.get("hypervisor.type"); - if (_hypervisorType == null) { - _hypervisorType = "kvm"; - } - - _hypervisorURI = (String) params.get("hypervisor.uri"); - if (_hypervisorURI == null) { - _hypervisorURI = "qemu:///system"; - } - String startMac = (String) params.get("private.macaddr.start"); - if (startMac == null) { - startMac = "00:16:3e:77:e2:a0"; - } - - String startIp = (String) params.get("private.ipaddr.start"); - if (startIp == null) { - startIp = "192.168.166.128"; - } - - _pingTestPath = Script.findScript(kvmScriptsDir, "pingtest.sh"); - if (_pingTestPath == null) { - throw new ConfigurationException("Unable to find the pingtest.sh"); - } - - _linkLocalBridgeName = (String) params.get("private.bridge.name"); - if (_linkLocalBridgeName == null) { - if (isDeveloper) { - _linkLocalBridgeName = "cloud-" + instance + "-0"; - } else { - _linkLocalBridgeName = "cloud0"; - } - } - - _publicBridgeName = (String) params.get("public.network.device"); - if (_publicBridgeName == null) { - _publicBridgeName = "cloudbr0"; - } - - _privBridgeName = (String) params.get("private.network.device"); - if (_privBridgeName == null) { - _privBridgeName = "cloudbr1"; - } - - _guestBridgeName = (String) params.get("guest.network.device"); - if (_guestBridgeName == null) { - _guestBridgeName = _privBridgeName; - } - - _privNwName = (String) params.get("private.network.name"); - if (_privNwName == null) { - if (isDeveloper) { - _privNwName = "cloud-" + instance + "-private"; - } else { - _privNwName = "cloud-private"; - } - } - - _localStoragePath = (String) params.get("local.storage.path"); - if (_localStoragePath == null) { - _localStoragePath = "/var/lib/libvirt/images/"; - } - - _localStorageUUID = (String) params.get("local.storage.uuid"); - if (_localStorageUUID == null) { - _localStorageUUID = UUID.randomUUID().toString(); - params.put("local.storage.uuid", _localStorageUUID); - } - - value = (String) params.get("scripts.timeout"); - _timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000; - - value = (String) params.get("stop.script.timeout"); - _stopTimeout = NumbersUtil.parseInt(value, 120) * 1000; - - value = (String) params.get("cmds.timeout"); - _cmdsTimeout = NumbersUtil.parseInt(value, 7200) * 1000; - - value = (String) params.get("host.reserved.mem.mb"); - _dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024; - - value = (String) params.get("debug.mode"); - - LibvirtConnection.initialize(_hypervisorURI); - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.getMessage()); - } - - /* Does node support HVM guest? If not, exit */ - if (!IsHVMEnabled(conn)) { - throw new ConfigurationException( - "NO HVM support on this machine, pls make sure: " - + "1. VT/SVM is supported by your CPU, or is enabled in BIOS. " - + "2. kvm modules is installed"); - } - - _hypervisorPath = getHypervisorPath(conn); - try { - _hvVersion = conn.getVersion(); - _hvVersion = (_hvVersion % 1000000) / 1000; - } catch (LibvirtException e) { - - } - - String[] info = NetUtils.getNetworkParams(_privateNic); - - _monitor = new KVMHAMonitor(null, info[0], _heartBeatPath); - Thread ha = new Thread(_monitor); - ha.start(); - - _storagePoolMgr = new KVMStoragePoolManager(_storage, _monitor); - - _sysvmISOPath = (String) params.get("systemvm.iso.path"); - if (_sysvmISOPath == null) { - String[] isoPaths = { "/usr/lib64/cloud/agent/vms/systemvm.iso", - "/usr/lib/cloud/agent/vms/systemvm.iso" }; - for (String isoPath : isoPaths) { - if (_storage.exists(isoPath)) { - _sysvmISOPath = isoPath; - break; - } - } - if (_sysvmISOPath == null) { - s_logger.debug("Can't find system vm ISO"); - } - } - - try { - createControlNetwork(conn); - } catch (LibvirtException e) { - throw new ConfigurationException(e.getMessage()); - } - - _pifs = getPifs(); - if (_pifs.first() == null) { - s_logger.debug("Failed to get private nic name"); - throw new ConfigurationException("Failed to get private nic name"); - } - - if (_pifs.second() == null) { - s_logger.debug("Failed to get public nic name"); - throw new ConfigurationException("Failed to get public nic name"); - } - s_logger.debug("Found pif: " + _pifs.first() + " on " + _privBridgeName - + ", pif: " + _pifs.second() + " on " + _publicBridgeName); - - _can_bridge_firewall = can_bridge_firewall(_pifs.second()); - - _localGateway = Script - .runSimpleBashScript("ip route |grep default|awk '{print $3}'"); - if (_localGateway == null) { - s_logger.debug("Failed to found the local gateway"); - } - - _mountPoint = (String) params.get("mount.path"); - if (_mountPoint == null) { - _mountPoint = "/mnt"; - } - - value = (String) params.get("vm.migrate.speed"); - _migrateSpeed = NumbersUtil.parseInt(value, -1); - if (_migrateSpeed == -1) { - //get guest network device speed - _migrateSpeed = 0; - String speed = Script.runSimpleBashScript("ethtool " + _pifs.second() + " |grep Speed | cut -d \\ -f 2"); - if (speed != null) { - String[] tokens = speed.split("M"); - if (tokens.length == 2) { - try { - _migrateSpeed = Integer.parseInt(tokens[0]); - } catch (Exception e) { - - } - s_logger.debug("device " + _pifs.second() + " has speed: " + String.valueOf(_migrateSpeed)); - } - } - params.put("vm.migrate.speed", String.valueOf(_migrateSpeed)); - } - saveProperties(params); - - return true; - } - - private Pair getPifs() { - /* get pifs from bridge */ - String pubPif = null; - String privPif = null; - String vlan = null; - if (_publicBridgeName != null) { - pubPif = Script.runSimpleBashScript("brctl show | grep " - + _publicBridgeName + " | awk '{print $4}'"); - vlan = Script.runSimpleBashScript("ls /proc/net/vlan/" + pubPif); - if (vlan != null && !vlan.isEmpty()) { - pubPif = Script - .runSimpleBashScript("grep ^Device\\: /proc/net/vlan/" - + pubPif + " | awk {'print $2'}"); - } - } - if (_guestBridgeName != null) { - privPif = Script.runSimpleBashScript("brctl show | grep " - + _guestBridgeName + " | awk '{print $4}'"); - vlan = Script.runSimpleBashScript("ls /proc/net/vlan/" + privPif); - if (vlan != null && !vlan.isEmpty()) { - privPif = Script - .runSimpleBashScript("grep ^Device\\: /proc/net/vlan/" - + privPif + " | awk {'print $2'}"); - } - } - return new Pair(privPif, pubPif); - } - - private boolean checkNetwork(String networkName) { - if (networkName == null) { - return true; - } - - String name = Script.runSimpleBashScript("brctl show | grep " - + networkName + " | awk '{print $4}'"); - if (name == null) { - return false; - } else { - return true; - } - } - - private String getVnetId(String vnetId) { - return vnetId; - } - - private void patchSystemVm(String cmdLine, String dataDiskPath, - String vmName) throws InternalErrorException { - String result; - final Script command = new Script(_patchdomrPath, _timeout, s_logger); - command.add("-l", vmName); - command.add("-t", "all"); - command.add("-d", dataDiskPath); - command.add("-p", cmdLine.replaceAll(" ", "%")); - result = command.execute(); - if (result != null) { - throw new InternalErrorException(result); - } - } - - boolean isDirectAttachedNetwork(String type) { - if ("untagged".equalsIgnoreCase(type)) { - return true; - } else { - try { - Long.valueOf(type); - } catch (NumberFormatException e) { - return true; - } - return false; - } - } - - protected String startDomain(Connect conn, String vmName, String domainXML) - throws LibvirtException, InternalErrorException { - /* No duplicated vm, we will success, or failed */ - boolean failed = false; - Domain dm = null; - try { - dm = conn.domainDefineXML(domainXML); - } catch (final LibvirtException e) { - /* Duplicated defined vm */ - s_logger.warn("Failed to define domain " + vmName + ": " - + e.getMessage()); - failed = true; - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (final LibvirtException e) { - - } - } - - /* If failed, undefine the vm */ - Domain dmOld = null; - Domain dmNew = null; - try { - if (failed) { - dmOld = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - dmOld.undefine(); - dmNew = conn.domainDefineXML(domainXML); - } - } catch (final LibvirtException e) { - s_logger.warn("Failed to define domain (second time) " + vmName - + ": " + e.getMessage()); - throw e; - } catch (Exception e) { - s_logger.warn("Failed to define domain (second time) " + vmName - + ": " + e.getMessage()); - throw new InternalErrorException(e.toString()); - } finally { - try { - if (dmOld != null) { - dmOld.free(); - } - if (dmNew != null) { - dmNew.free(); - } - } catch (final LibvirtException e) { - - } - } - - /* Start the VM */ - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - dm.create(); - } catch (LibvirtException e) { - s_logger.warn("Failed to start domain: " + vmName + ": " - + e.getMessage()); - throw e; - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (final LibvirtException e) { - - } - } - return null; - } - - @Override - public boolean stop() { - try { - Connect conn = LibvirtConnection.getConnection(); - conn.close(); - } catch (LibvirtException e) { - } - - return true; - } - - public static void main(String[] args) { - s_logger.addAppender(new org.apache.log4j.ConsoleAppender( - new org.apache.log4j.PatternLayout(), "System.out")); - LibvirtComputingResource test = new LibvirtComputingResource(); - Map params = new HashMap(); - try { - test.configure("test", params); - } catch (ConfigurationException e) { - System.out.println(e.getMessage()); - e.printStackTrace(); - } - String result = null; - // String result = test.startDomainRouter("domr1", - // "/var/lib/images/centos.5-4.x86-64/centos-small.img", 128, "0064", - // "02:00:30:00:01:01", "00:16:3e:77:e2:a1", "02:00:30:00:64:01"); - boolean created = (result == null); - s_logger.info("Domain " + (created ? " " : " not ") + " created"); - - s_logger.info("Rule " + (created ? " " : " not ") + " created"); - test.stop(); - } - - @Override - public Answer executeRequest(Command cmd) { - - try { - if (cmd instanceof StopCommand) { - return execute((StopCommand) cmd); - } else if (cmd instanceof GetVmStatsCommand) { - return execute((GetVmStatsCommand) cmd); - } else if (cmd instanceof RebootRouterCommand) { - return execute((RebootRouterCommand) cmd); - } else if (cmd instanceof RebootCommand) { - return execute((RebootCommand) cmd); - } else if (cmd instanceof GetHostStatsCommand) { - return execute((GetHostStatsCommand) cmd); - } else if (cmd instanceof CheckStateCommand) { - return executeRequest(cmd); - } else if (cmd instanceof CheckHealthCommand) { - return execute((CheckHealthCommand) cmd); - } else if (cmd instanceof PrepareForMigrationCommand) { - return execute((PrepareForMigrationCommand) cmd); - } else if (cmd instanceof MigrateCommand) { - return execute((MigrateCommand) cmd); - } else if (cmd instanceof PingTestCommand) { - return execute((PingTestCommand) cmd); - } else if (cmd instanceof CheckVirtualMachineCommand) { - return execute((CheckVirtualMachineCommand) cmd); - } else if (cmd instanceof ReadyCommand) { - return execute((ReadyCommand) cmd); - } else if (cmd instanceof AttachIsoCommand) { - return execute((AttachIsoCommand) cmd); - } else if (cmd instanceof AttachVolumeCommand) { - return execute((AttachVolumeCommand) cmd); - } else if (cmd instanceof StopCommand) { - return execute((StopCommand) cmd); - } else if (cmd instanceof CheckConsoleProxyLoadCommand) { - return execute((CheckConsoleProxyLoadCommand) cmd); - } else if (cmd instanceof WatchConsoleProxyLoadCommand) { - return execute((WatchConsoleProxyLoadCommand) cmd); - } else if (cmd instanceof GetVncPortCommand) { - return execute((GetVncPortCommand) cmd); - } else if (cmd instanceof ModifySshKeysCommand) { - return execute((ModifySshKeysCommand) cmd); - } else if (cmd instanceof MaintainCommand) { - return execute((MaintainCommand) cmd); - } else if (cmd instanceof CreateCommand) { - return execute((CreateCommand) cmd); - } else if (cmd instanceof DestroyCommand) { - return execute((DestroyCommand) cmd); - } else if (cmd instanceof PrimaryStorageDownloadCommand) { - return execute((PrimaryStorageDownloadCommand) cmd); - } else if (cmd instanceof CreatePrivateTemplateFromVolumeCommand) { - return execute((CreatePrivateTemplateFromVolumeCommand) cmd); - } else if (cmd instanceof GetStorageStatsCommand) { - return execute((GetStorageStatsCommand) cmd); - } else if (cmd instanceof ManageSnapshotCommand) { - return execute((ManageSnapshotCommand) cmd); - } else if (cmd instanceof BackupSnapshotCommand) { - return execute((BackupSnapshotCommand) cmd); - } else if (cmd instanceof CreateVolumeFromSnapshotCommand) { - return execute((CreateVolumeFromSnapshotCommand) cmd); - } else if (cmd instanceof CreatePrivateTemplateFromSnapshotCommand) { - return execute((CreatePrivateTemplateFromSnapshotCommand) cmd); - } else if (cmd instanceof UpgradeSnapshotCommand) { - return execute((UpgradeSnapshotCommand) cmd); - } else if (cmd instanceof CreateStoragePoolCommand) { - return execute((CreateStoragePoolCommand) cmd); - } else if (cmd instanceof ModifyStoragePoolCommand) { - return execute((ModifyStoragePoolCommand) cmd); - } else if (cmd instanceof SecurityGroupRulesCmd) { - return execute((SecurityGroupRulesCmd) cmd); - } else if (cmd instanceof DeleteStoragePoolCommand) { - return execute((DeleteStoragePoolCommand) cmd); - } else if (cmd instanceof FenceCommand) { - return execute((FenceCommand) cmd); - } else if (cmd instanceof StartCommand) { - return execute((StartCommand) cmd); - } else if (cmd instanceof IpAssocCommand) { - return execute((IpAssocCommand) cmd); - } else if (cmd instanceof NetworkElementCommand) { - return _virtRouterResource.executeRequest(cmd); - } else if (cmd instanceof CheckSshCommand) { - return execute((CheckSshCommand) cmd); - } else if (cmd instanceof NetworkUsageCommand) { - return execute((NetworkUsageCommand) cmd); - } else if (cmd instanceof NetworkRulesSystemVmCommand) { - return execute((NetworkRulesSystemVmCommand) cmd); - } else if (cmd instanceof CleanupNetworkRulesCmd) { - return execute((CleanupNetworkRulesCmd) cmd); - } else if (cmd instanceof CopyVolumeCommand) { - return execute((CopyVolumeCommand) cmd); - } else if (cmd instanceof CheckNetworkCommand) { - return execute((CheckNetworkCommand) cmd); - } else { - s_logger.warn("Unsupported command "); - return Answer.createUnsupportedCommandAnswer(cmd); - } - } catch (final IllegalArgumentException e) { - return new Answer(cmd, false, e.getMessage()); - } - } - - private CheckNetworkAnswer execute(CheckNetworkCommand cmd) { - List phyNics = cmd - .getPhysicalNetworkInfoList(); - String errMsg = null; - for (PhysicalNetworkSetupInfo nic : phyNics) { - if (!checkNetwork(nic.getGuestNetworkName())) { - errMsg = "Can not find network: " + nic.getGuestNetworkName(); - break; - } else if (!checkNetwork(nic.getPrivateNetworkName())) { - errMsg = "Can not find network: " + nic.getPrivateNetworkName(); - break; - } else if (!checkNetwork(nic.getPublicNetworkName())) { - errMsg = "Can not find network: " + nic.getPublicNetworkName(); - break; - } - } - - if (errMsg != null) { - return new CheckNetworkAnswer(cmd, false, errMsg); - } else { - return new CheckNetworkAnswer(cmd, true, null); - } - } - - private CopyVolumeAnswer execute(CopyVolumeCommand cmd) { - boolean copyToSecondary = cmd.toSecondaryStorage(); - String volumePath = cmd.getVolumePath(); - StorageFilerTO pool = cmd.getPool(); - String secondaryStorageUrl = cmd.getSecondaryStorageURL(); - KVMStoragePool secondaryStoragePool = null; - try { - KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(pool - .getUuid()); - String volumeName = UUID.randomUUID().toString(); - - if (copyToSecondary) { - String destVolumeName = volumeName + ".qcow2"; - KVMPhysicalDisk volume = primaryPool.getPhysicalDisk(cmd - .getVolumePath()); - String volumeDestPath = "/volumes/" + cmd.getVolumeId() - + File.separator; - secondaryStoragePool = _storagePoolMgr - .getStoragePoolByURI(secondaryStorageUrl); - secondaryStoragePool.createFolder(volumeDestPath); - secondaryStoragePool.delete(); - secondaryStoragePool = _storagePoolMgr - .getStoragePoolByURI(secondaryStorageUrl - + volumeDestPath); - _storagePoolMgr.copyPhysicalDisk(volume, destVolumeName, - secondaryStoragePool); - return new CopyVolumeAnswer(cmd, true, null, null, volumeName); - } else { - volumePath = "/volumes/" + cmd.getVolumeId() + File.separator; - secondaryStoragePool = _storagePoolMgr - .getStoragePoolByURI(secondaryStorageUrl + volumePath); - KVMPhysicalDisk volume = secondaryStoragePool - .getPhysicalDisk(cmd.getVolumePath() + ".qcow2"); - _storagePoolMgr.copyPhysicalDisk(volume, volumeName, - primaryPool); - return new CopyVolumeAnswer(cmd, true, null, null, volumeName); - } - } catch (CloudRuntimeException e) { - return new CopyVolumeAnswer(cmd, false, e.toString(), null, null); - } finally { - if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); - } - } - } - - protected Answer execute(DeleteStoragePoolCommand cmd) { - try { - _storagePoolMgr.deleteStoragePool(cmd.getPool().getUuid()); - return new Answer(cmd); - } catch (CloudRuntimeException e) { - return new Answer(cmd, false, e.toString()); - } - } - - protected FenceAnswer execute(FenceCommand cmd) { - ExecutorService executors = Executors.newSingleThreadExecutor(); - List pools = _monitor.getStoragePools(); - KVMHAChecker ha = new KVMHAChecker(pools, cmd.getHostIp()); - Future future = executors.submit(ha); - try { - Boolean result = future.get(); - if (result) { - return new FenceAnswer(cmd, false, "Heart is still beating..."); - } else { - return new FenceAnswer(cmd); - } - } catch (InterruptedException e) { - s_logger.warn("Unable to fence", e); - return new FenceAnswer(cmd, false, e.getMessage()); - } catch (ExecutionException e) { - s_logger.warn("Unable to fence", e); - return new FenceAnswer(cmd, false, e.getMessage()); - } - - } - - protected Storage.StorageResourceType getStorageResourceType() { - return Storage.StorageResourceType.STORAGE_POOL; - } - - protected Answer execute(CreateCommand cmd) { - StorageFilerTO pool = cmd.getPool(); - DiskProfile dskch = cmd.getDiskCharacteristics(); - KVMPhysicalDisk BaseVol = null; - KVMStoragePool primaryPool = null; - KVMPhysicalDisk vol = null; - long disksize; - try { - primaryPool = _storagePoolMgr.getStoragePool(pool.getUuid()); - - if (cmd.getTemplateUrl() != null) { - - BaseVol = primaryPool.getPhysicalDisk(cmd.getTemplateUrl()); - vol = _storagePoolMgr.createDiskFromTemplate(BaseVol, UUID - .randomUUID().toString(), primaryPool); - - if (vol == null) { - return new Answer(cmd, false, - " Can't create storage volume on storage pool"); - } - disksize = vol.getSize(); - } else { - disksize = dskch.getSize(); - vol = primaryPool.createPhysicalDisk(UUID.randomUUID() - .toString(), dskch.getSize()); - } - VolumeTO volume = new VolumeTO(cmd.getVolumeId(), dskch.getType(), - pool.getType(), pool.getUuid(), pool.getPath(), - vol.getName(), vol.getName(), disksize, null); - return new CreateAnswer(cmd, volume); - } catch (CloudRuntimeException e) { - s_logger.debug("Failed to create volume: " + e.toString()); - return new CreateAnswer(cmd, e); - } - } - - public Answer execute(DestroyCommand cmd) { - VolumeTO vol = cmd.getVolume(); - - try { - KVMStoragePool pool = _storagePoolMgr.getStoragePool(vol - .getPoolUuid()); - pool.deletePhysicalDisk(vol.getPath()); - - return new Answer(cmd, true, "Success"); - } catch (CloudRuntimeException e) { - s_logger.debug("Failed to delete volume: " + e.toString()); - return new Answer(cmd, false, e.toString()); - } - } - - private String getVlanIdFromBridge(String brName) { - OutputInterpreter.OneLineParser vlanIdParser = new OutputInterpreter.OneLineParser(); - final Script cmd = new Script("/bin/bash", s_logger); - cmd.add("-c"); - cmd.add("vlanid=$(brctl show |grep " + brName - + " |awk '{print $4}' | cut -s -d. -f 2);echo $vlanid"); - String result = cmd.execute(vlanIdParser); - if (result != null) { - return null; - } - String vlanId = vlanIdParser.getLine(); - if (vlanId.equalsIgnoreCase("")) { - return null; - } else { - return vlanId; - } - } - - private void VifHotPlug(Connect conn, String vmName, String vlanId, - String macAddr) throws InternalErrorException, LibvirtException { - NicTO nicTO = new NicTO(); - nicTO.setMac(macAddr); - nicTO.setType(TrafficType.Public); - if (vlanId == null) { - nicTO.setBroadcastType(BroadcastDomainType.Native); - } else { - nicTO.setBroadcastType(BroadcastDomainType.Vlan); - nicTO.setBroadcastUri(BroadcastDomainType.Vlan.toUri(vlanId)); - } - - InterfaceDef nic = createVif(conn, nicTO, InterfaceDef.nicModel.VIRTIO); - Domain vm = getDomain(conn, vmName); - vm.attachDevice(nic.toString()); - } - - public Answer execute(IpAssocCommand cmd) { - String routerName = cmd - .getAccessDetail(NetworkElementCommand.ROUTER_NAME); - String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); - String[] results = new String[cmd.getIpAddresses().length]; - Connect conn; - try { - conn = LibvirtConnection.getConnection(); - List nics = getInterfaces(conn, routerName); - Map vlanAllocatedToVM = new HashMap(); - Integer nicPos = 0; - for (InterfaceDef nic : nics) { - if (nic.getBrName().equalsIgnoreCase(_linkLocalBridgeName)) { - vlanAllocatedToVM.put("LinkLocal", nicPos); - } else { - String vlanId = getVlanIdFromBridge(nic.getBrName()); - if (vlanId != null) { - vlanAllocatedToVM.put(vlanId, nicPos); - } else { - vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos); - } - } - nicPos++; - } - IpAddressTO[] ips = cmd.getIpAddresses(); - int i = 0; - String result = null; - int nicNum = 0; - for (IpAddressTO ip : ips) { - if (!vlanAllocatedToVM.containsKey(ip.getVlanId())) { - /* plug a vif into router */ - VifHotPlug(conn, routerName, ip.getVlanId(), - ip.getVifMacAddress()); - vlanAllocatedToVM.put(ip.getVlanId(), nicPos++); - } - nicNum = vlanAllocatedToVM.get(ip.getVlanId()); - networkUsage(routerIp, "addVif", "eth" + nicNum); - result = _virtRouterResource.assignPublicIpAddress(routerName, - routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), - ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), - ip.getVlanNetmask(), ip.getVifMacAddress(), - ip.getGuestIp(), nicNum); - - if (result != null) { - results[i++] = IpAssocAnswer.errorResult; - } else { - results[i++] = ip.getPublicIp() + " - success"; - ; - } - } - return new IpAssocAnswer(cmd, results); - } catch (LibvirtException e) { - return new IpAssocAnswer(cmd, results); - } catch (InternalErrorException e) { - return new IpAssocAnswer(cmd, results); - } - } - - protected ManageSnapshotAnswer execute(final ManageSnapshotCommand cmd) { - String snapshotName = cmd.getSnapshotName(); - String snapshotPath = cmd.getSnapshotPath(); - String vmName = cmd.getVmName(); - try { - Connect conn = LibvirtConnection.getConnection(); - DomainInfo.DomainState state = null; - Domain vm = null; - if (vmName != null) { - try { - vm = getDomain(conn, cmd.getVmName()); - state = vm.getInfo().state; - } catch (LibvirtException e) { - - } - } - - KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd - .getPool().getUuid()); - KVMPhysicalDisk disk = primaryPool.getPhysicalDisk(cmd - .getVolumePath()); - if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING - && !primaryPool.isExternalSnapshot()) { - String vmUuid = vm.getUUIDString(); - Object[] args = new Object[] { snapshotName, vmUuid }; - String snapshot = SnapshotXML.format(args); - s_logger.debug(snapshot); - if (cmd.getCommandSwitch().equalsIgnoreCase( - ManageSnapshotCommand.CREATE_SNAPSHOT)) { - vm.snapshotCreateXML(snapshot); - } else { - DomainSnapshot snap = vm.snapshotLookupByName(snapshotName); - snap.delete(0); - } - - /* - * libvirt on RHEL6 doesn't handle resume event emitted from - * qemu - */ - vm = getDomain(conn, cmd.getVmName()); - state = vm.getInfo().state; - if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) { - vm.resume(); - } - } else { - - /* VM is not running, create a snapshot by ourself */ - final Script command = new Script(_manageSnapshotPath, - _cmdsTimeout, s_logger); - if (cmd.getCommandSwitch().equalsIgnoreCase( - ManageSnapshotCommand.CREATE_SNAPSHOT)) { - command.add("-c", disk.getPath()); - } else { - command.add("-d", snapshotPath); - } - - command.add("-n", snapshotName); - String result = command.execute(); - if (result != null) { - s_logger.debug("Failed to manage snapshot: " + result); - return new ManageSnapshotAnswer(cmd, false, - "Failed to manage snapshot: " + result); - } - } - return new ManageSnapshotAnswer(cmd, cmd.getSnapshotId(), - disk.getPath() + File.separator + snapshotName, true, null); - } catch (LibvirtException e) { - s_logger.debug("Failed to manage snapshot: " + e.toString()); - return new ManageSnapshotAnswer(cmd, false, - "Failed to manage snapshot: " + e.toString()); - } - - } - - protected BackupSnapshotAnswer execute(final BackupSnapshotCommand cmd) { - Long dcId = cmd.getDataCenterId(); - Long accountId = cmd.getAccountId(); - Long volumeId = cmd.getVolumeId(); - String secondaryStoragePoolUrl = cmd.getSecondaryStorageUrl(); - String snapshotName = cmd.getSnapshotName(); - String snapshotPath = cmd.getVolumePath(); - String snapshotDestPath = null; - String snapshotRelPath = null; - String vmName = cmd.getVmName(); - KVMStoragePool secondaryStoragePool = null; - try { - Connect conn = LibvirtConnection.getConnection(); - - secondaryStoragePool = _storagePoolMgr - .getStoragePoolByURI(secondaryStoragePoolUrl); - - String ssPmountPath = secondaryStoragePool.getLocalPath(); - snapshotRelPath = File.separator + "snapshots" + File.separator - + dcId + File.separator + accountId + File.separator - + volumeId; - - snapshotDestPath = ssPmountPath + File.separator + "snapshots" - + File.separator + dcId + File.separator + accountId - + File.separator + volumeId; - KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd - .getPrimaryStoragePoolNameLabel()); - KVMPhysicalDisk snapshotDisk = primaryPool.getPhysicalDisk(cmd - .getVolumePath()); - Script command = new Script(_manageSnapshotPath, _cmdsTimeout, - s_logger); - command.add("-b", snapshotDisk.getPath()); - command.add("-n", snapshotName); - command.add("-p", snapshotDestPath); - command.add("-t", snapshotName); - String result = command.execute(); - if (result != null) { - s_logger.debug("Failed to backup snaptshot: " + result); - return new BackupSnapshotAnswer(cmd, false, result, null, true); - } - /* Delete the snapshot on primary */ - - DomainInfo.DomainState state = null; - Domain vm = null; - if (vmName != null) { - try { - vm = getDomain(conn, cmd.getVmName()); - state = vm.getInfo().state; - } catch (LibvirtException e) { - - } - } - - KVMStoragePool primaryStorage = _storagePoolMgr.getStoragePool(cmd - .getPool().getUuid()); - if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING - && !primaryStorage.isExternalSnapshot()) { - String vmUuid = vm.getUUIDString(); - Object[] args = new Object[] { snapshotName, vmUuid }; - String snapshot = SnapshotXML.format(args); - s_logger.debug(snapshot); - DomainSnapshot snap = vm.snapshotLookupByName(snapshotName); - snap.delete(0); - - /* - * libvirt on RHEL6 doesn't handle resume event emitted from - * qemu - */ - vm = getDomain(conn, cmd.getVmName()); - state = vm.getInfo().state; - if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) { - vm.resume(); - } - } else { - command = new Script(_manageSnapshotPath, _cmdsTimeout, - s_logger); - command.add("-d", snapshotDisk.getPath()); - command.add("-n", snapshotName); - result = command.execute(); - if (result != null) { - s_logger.debug("Failed to backup snapshot: " + result); - return new BackupSnapshotAnswer(cmd, false, - "Failed to backup snapshot: " + result, null, true); - } - } - } catch (LibvirtException e) { - return new BackupSnapshotAnswer(cmd, false, e.toString(), null, - true); - } catch (CloudRuntimeException e) { - return new BackupSnapshotAnswer(cmd, false, e.toString(), null, - true); - } finally { - if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); - } - } - return new BackupSnapshotAnswer(cmd, true, null, snapshotRelPath - + File.separator + snapshotName, true); - } - - protected DeleteSnapshotBackupAnswer execute( - final DeleteSnapshotBackupCommand cmd) { - Long dcId = cmd.getDataCenterId(); - Long accountId = cmd.getAccountId(); - Long volumeId = cmd.getVolumeId(); - KVMStoragePool secondaryStoragePool = null; - try { - secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI(cmd - .getSecondaryStorageUrl()); - - String ssPmountPath = secondaryStoragePool.getLocalPath(); - String snapshotDestPath = ssPmountPath + File.separator - + "snapshots" + File.separator + dcId + File.separator - + accountId + File.separator + volumeId; - - final Script command = new Script(_manageSnapshotPath, - _cmdsTimeout, s_logger); - command.add("-d", snapshotDestPath); - command.add("-n", cmd.getSnapshotName()); - - command.execute(); - } catch (CloudRuntimeException e) { - return new DeleteSnapshotBackupAnswer(cmd, false, e.toString()); - } finally { - if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); - } - } - return new DeleteSnapshotBackupAnswer(cmd, true, null); - } - - protected Answer execute(DeleteSnapshotsDirCommand cmd) { - Long dcId = cmd.getDcId(); - Long accountId = cmd.getAccountId(); - Long volumeId = cmd.getVolumeId(); - KVMStoragePool secondaryStoragePool = null; - try { - secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI(cmd - .getSecondaryStorageUrl()); - - String ssPmountPath = secondaryStoragePool.getLocalPath(); - String snapshotDestPath = ssPmountPath + File.separator - + "snapshots" + File.separator + dcId + File.separator - + accountId + File.separator + volumeId; - - final Script command = new Script(_manageSnapshotPath, - _cmdsTimeout, s_logger); - command.add("-d", snapshotDestPath); - command.add("-f"); - command.execute(); - } catch (CloudRuntimeException e) { - return new Answer(cmd, false, e.toString()); - } finally { - if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); - } - - } - return new Answer(cmd, true, null); - } - - protected CreateVolumeFromSnapshotAnswer execute( - final CreateVolumeFromSnapshotCommand cmd) { - try { - - String snapshotPath = cmd.getSnapshotUuid(); - int index = snapshotPath.lastIndexOf("/"); - snapshotPath = snapshotPath.substring(0, index); - KVMStoragePool secondaryPool = _storagePoolMgr - .getStoragePoolByURI(cmd.getSecondaryStorageUrl() - + snapshotPath); - KVMPhysicalDisk snapshot = secondaryPool.getPhysicalDisk(cmd - .getSnapshotName()); - - String primaryUuid = cmd.getPrimaryStoragePoolNameLabel(); - KVMStoragePool primaryPool = _storagePoolMgr - .getStoragePool(primaryUuid); - String volUuid = UUID.randomUUID().toString(); - KVMPhysicalDisk disk = _storagePoolMgr.copyPhysicalDisk(snapshot, - volUuid, primaryPool); - return new CreateVolumeFromSnapshotAnswer(cmd, true, "", - disk.getName()); - } catch (CloudRuntimeException e) { - return new CreateVolumeFromSnapshotAnswer(cmd, false, e.toString(), - null); - } - } - - protected Answer execute(final UpgradeSnapshotCommand cmd) { - - return new Answer(cmd, true, "success"); - } - - protected CreatePrivateTemplateAnswer execute( - final CreatePrivateTemplateFromSnapshotCommand cmd) { - String templateFolder = cmd.getAccountId() + File.separator - + cmd.getNewTemplateId(); - String templateInstallFolder = "template/tmpl/" + templateFolder; - String tmplName = UUID.randomUUID().toString(); - String tmplFileName = tmplName + ".qcow2"; - KVMStoragePool secondaryPool = null; - KVMStoragePool snapshotPool = null; - try { - String snapshotPath = cmd.getSnapshotUuid(); - int index = snapshotPath.lastIndexOf("/"); - snapshotPath = snapshotPath.substring(0, index); - snapshotPool = _storagePoolMgr.getStoragePoolByURI(cmd - .getSecondaryStorageUrl() + snapshotPath); - KVMPhysicalDisk snapshot = snapshotPool.getPhysicalDisk(cmd - .getSnapshotName()); - - secondaryPool = _storagePoolMgr.getStoragePoolByURI(cmd - .getSecondaryStorageUrl()); - - String templatePath = secondaryPool.getLocalPath() + File.separator - + templateInstallFolder; - - _storage.mkdirs(templatePath); - - String tmplPath = templateInstallFolder + File.separator - + tmplFileName; - Script command = new Script(_createTmplPath, _cmdsTimeout, s_logger); - command.add("-t", templatePath); - command.add("-n", tmplFileName); - command.add("-f", snapshot.getPath()); - command.execute(); - - Map params = new HashMap(); - params.put(StorageLayer.InstanceConfigKey, _storage); - Processor qcow2Processor = new QCOW2Processor(); - qcow2Processor.configure("QCOW2 Processor", params); - FormatInfo info = qcow2Processor.process(templatePath, null, - tmplName); - - TemplateLocation loc = new TemplateLocation(_storage, templatePath); - loc.create(1, true, tmplName); - loc.addFormat(info); - loc.save(); - - return new CreatePrivateTemplateAnswer(cmd, true, "", tmplPath, - info.virtualSize, info.size, tmplName, info.format); - } catch (ConfigurationException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); - } catch (InternalErrorException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); - } catch (IOException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); - } catch (CloudRuntimeException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); - } finally { - if (secondaryPool != null) { - secondaryPool.delete(); - } - if (snapshotPool != null) { - snapshotPool.delete(); - } - } - } - - protected GetStorageStatsAnswer execute(final GetStorageStatsCommand cmd) { - try { - KVMStoragePool sp = _storagePoolMgr.getStoragePool(cmd - .getStorageId()); - return new GetStorageStatsAnswer(cmd, sp.getCapacity(), - sp.getUsed()); - } catch (CloudRuntimeException e) { - return new GetStorageStatsAnswer(cmd, e.toString()); - } - } - - protected CreatePrivateTemplateAnswer execute( - CreatePrivateTemplateFromVolumeCommand cmd) { - String secondaryStorageURL = cmd.getSecondaryStorageUrl(); - - KVMStoragePool secondaryStorage = null; - try { - Connect conn = LibvirtConnection.getConnection(); - String templateFolder = cmd.getAccountId() + File.separator - + cmd.getTemplateId() + File.separator; - String templateInstallFolder = "/template/tmpl/" + templateFolder; - - secondaryStorage = _storagePoolMgr - .getStoragePoolByURI(secondaryStorageURL); - - KVMStoragePool primary = _storagePoolMgr.getStoragePool(cmd - .getPrimaryStoragePoolNameLabel()); - KVMPhysicalDisk disk = primary.getPhysicalDisk(cmd.getVolumePath()); - String tmpltPath = secondaryStorage.getLocalPath() + File.separator - + templateInstallFolder; - _storage.mkdirs(tmpltPath); - - Script command = new Script(_createTmplPath, _cmdsTimeout, s_logger); - command.add("-f", disk.getPath()); - command.add("-t", tmpltPath); - command.add("-n", cmd.getUniqueName() + ".qcow2"); - - String result = command.execute(); - - if (result != null) { - s_logger.debug("failed to create template: " + result); - return new CreatePrivateTemplateAnswer(cmd, false, result); - } - - Map params = new HashMap(); - params.put(StorageLayer.InstanceConfigKey, _storage); - Processor qcow2Processor = new QCOW2Processor(); - - qcow2Processor.configure("QCOW2 Processor", params); - - FormatInfo info = qcow2Processor.process(tmpltPath, null, - cmd.getUniqueName()); - - TemplateLocation loc = new TemplateLocation(_storage, tmpltPath); - loc.create(1, true, cmd.getUniqueName()); - loc.addFormat(info); - loc.save(); - - return new CreatePrivateTemplateAnswer(cmd, true, null, - templateInstallFolder + cmd.getUniqueName() + ".qcow2", - info.virtualSize, info.size, cmd.getUniqueName(), - ImageFormat.QCOW2); - } catch (LibvirtException e) { - s_logger.debug("Failed to get secondary storage pool: " - + e.toString()); - return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); - } catch (InternalErrorException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); - } catch (IOException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); - } catch (ConfigurationException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); - } catch (CloudRuntimeException e) { - return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); - } finally { - if (secondaryStorage != null) { - secondaryStorage.delete(); - } - } - } - - protected PrimaryStorageDownloadAnswer execute( - final PrimaryStorageDownloadCommand cmd) { - String tmplturl = cmd.getUrl(); - int index = tmplturl.lastIndexOf("/"); - String mountpoint = tmplturl.substring(0, index); - String tmpltname = null; - if (index < tmplturl.length() - 1) { - tmpltname = tmplturl.substring(index + 1); - } - - KVMPhysicalDisk tmplVol = null; - KVMStoragePool secondaryPool = null; - try { - secondaryPool = _storagePoolMgr.getStoragePoolByURI(mountpoint); - - /* Get template vol */ - if (tmpltname == null) { - secondaryPool.refresh(); - List disks = secondaryPool.listPhysicalDisks(); - if (disks == null || disks.isEmpty()) { - return new PrimaryStorageDownloadAnswer( - "Failed to get volumes from pool: " - + secondaryPool.getUuid()); - } - for (KVMPhysicalDisk disk : disks) { - if (disk.getName().endsWith("qcow2")) { - tmplVol = disk; - break; - } - } - if (tmplVol == null) { - return new PrimaryStorageDownloadAnswer( - "Failed to get template from pool: " - + secondaryPool.getUuid()); - } - } else { - tmplVol = secondaryPool.getPhysicalDisk(tmpltname); - } - - /* Copy volume to primary storage */ - KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd - .getPoolUuid()); - - KVMPhysicalDisk primaryVol = _storagePoolMgr.copyPhysicalDisk( - tmplVol, UUID.randomUUID().toString(), primaryPool); - - return new PrimaryStorageDownloadAnswer(primaryVol.getName(), - primaryVol.getSize()); - } catch (CloudRuntimeException e) { - return new PrimaryStorageDownloadAnswer(e.toString()); - } finally { - if (secondaryPool != null) { - secondaryPool.delete(); - } - } - } - - protected Answer execute(CreateStoragePoolCommand cmd) { - return new Answer(cmd, true, "success"); - } - - protected Answer execute(ModifyStoragePoolCommand cmd) { - KVMStoragePool storagepool = _storagePoolMgr.createStoragePool(cmd - .getPool().getUuid(), cmd.getPool().getHost(), cmd.getPool() - .getPath(), cmd.getPool().getType()); - if (storagepool == null) { - return new Answer(cmd, false, " Failed to create storage pool"); - } - - Map tInfo = new HashMap(); - ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, - storagepool.getCapacity(), storagepool.getUsed(), tInfo); - - return answer; - } - - private Answer execute(SecurityGroupRulesCmd cmd) { - String vif = null; - String brname = null; - try { - Connect conn = LibvirtConnection.getConnection(); - List nics = getInterfaces(conn, cmd.getVmName()); - vif = nics.get(0).getDevName(); - brname = nics.get(0).getBrName(); - } catch (LibvirtException e) { - return new SecurityGroupRuleAnswer(cmd, false, e.toString()); - } - - boolean result = add_network_rules(cmd.getVmName(), - Long.toString(cmd.getVmId()), cmd.getGuestIp(), - cmd.getSignature(), Long.toString(cmd.getSeqNum()), - cmd.getGuestMac(), cmd.stringifyRules(), vif, brname); - - if (!result) { - s_logger.warn("Failed to program network rules for vm " - + cmd.getVmName()); - return new SecurityGroupRuleAnswer(cmd, false, - "programming network rules failed"); - } else { - s_logger.debug("Programmed network rules for vm " + cmd.getVmName() - + " guestIp=" + cmd.getGuestIp() + ",ingress numrules=" - + cmd.getIngressRuleSet().length + ",egress numrules=" - + cmd.getEgressRuleSet().length); - return new SecurityGroupRuleAnswer(cmd); - } - } - - private Answer execute(CleanupNetworkRulesCmd cmd) { - boolean result = cleanup_rules(); - return new Answer(cmd, result, ""); - } - - protected GetVncPortAnswer execute(GetVncPortCommand cmd) { - try { - Connect conn = LibvirtConnection.getConnection(); - Integer vncPort = getVncPort(conn, cmd.getName()); - return new GetVncPortAnswer(cmd, _privateIp, 5900 + vncPort); - } catch (Exception e) { - return new GetVncPortAnswer(cmd, e.toString()); - } - } - - protected Answer execute(final CheckConsoleProxyLoadCommand cmd) { - return executeProxyLoadScan(cmd, cmd.getProxyVmId(), - cmd.getProxyVmName(), cmd.getProxyManagementIp(), - cmd.getProxyCmdPort()); - } - - protected Answer execute(final WatchConsoleProxyLoadCommand cmd) { - return executeProxyLoadScan(cmd, cmd.getProxyVmId(), - cmd.getProxyVmName(), cmd.getProxyManagementIp(), - cmd.getProxyCmdPort()); - } - - protected MaintainAnswer execute(MaintainCommand cmd) { - return new MaintainAnswer(cmd); - } - - private Answer executeProxyLoadScan(final Command cmd, - final long proxyVmId, final String proxyVmName, - final String proxyManagementIp, final int cmdPort) { - String result = null; - - final StringBuffer sb = new StringBuffer(); - sb.append("http://").append(proxyManagementIp).append(":" + cmdPort) - .append("/cmd/getstatus"); - - boolean success = true; - try { - final URL url = new URL(sb.toString()); - final URLConnection conn = url.openConnection(); - - final InputStream is = conn.getInputStream(); - final BufferedReader reader = new BufferedReader( - new InputStreamReader(is)); - final StringBuilder sb2 = new StringBuilder(); - String line = null; - try { - while ((line = reader.readLine()) != null) { - sb2.append(line + "\n"); - } - result = sb2.toString(); - } catch (final IOException e) { - success = false; - } finally { - try { - is.close(); - } catch (final IOException e) { - s_logger.warn("Exception when closing , console proxy address : " - + proxyManagementIp); - success = false; - } - } - } catch (final IOException e) { - s_logger.warn("Unable to open console proxy command port url, console proxy address : " - + proxyManagementIp); - success = false; - } - - return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, - result); - } - - private Answer execute(AttachIsoCommand cmd) { - try { - Connect conn = LibvirtConnection.getConnection(); - attachOrDetachISO(conn, cmd.getVmName(), cmd.getIsoPath(), - cmd.isAttach()); - } catch (LibvirtException e) { - return new Answer(cmd, false, e.toString()); - } catch (URISyntaxException e) { - return new Answer(cmd, false, e.toString()); - } catch (InternalErrorException e) { - return new Answer(cmd, false, e.toString()); - } - - return new Answer(cmd); - } - - private AttachVolumeAnswer execute(AttachVolumeCommand cmd) { - try { - Connect conn = LibvirtConnection.getConnection(); - KVMStoragePool primary = _storagePoolMgr.getStoragePool(cmd - .getPoolUuid()); - KVMPhysicalDisk disk = primary.getPhysicalDisk(cmd.getVolumePath()); - attachOrDetachDisk(conn, cmd.getAttach(), cmd.getVmName(), disk, - cmd.getDeviceId().intValue()); - } catch (LibvirtException e) { - return new AttachVolumeAnswer(cmd, e.toString()); - } catch (InternalErrorException e) { - return new AttachVolumeAnswer(cmd, e.toString()); - } - - return new AttachVolumeAnswer(cmd, cmd.getDeviceId()); - } - - private Answer execute(ReadyCommand cmd) { - return new ReadyAnswer(cmd); - } - - protected State convertToState(DomainInfo.DomainState ps) { - final State state = s_statesTable.get(ps); - return state == null ? State.Unknown : state; - } - - protected State getVmState(Connect conn, final String vmName) { - int retry = 3; - Domain vms = null; - while (retry-- > 0) { - try { - vms = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - State s = convertToState(vms.getInfo().state); - return s; - } catch (final LibvirtException e) { - s_logger.warn("Can't get vm state " + vmName + e.getMessage() - + "retry:" + retry); - } catch (Exception e) { - s_logger.warn("Can't get vm state " + vmName + e.getMessage() - + "retry:" + retry); - } finally { - try { - if (vms != null) { - vms.free(); - } - } catch (final LibvirtException e) { - - } - } - } - return State.Stopped; - } - - private Answer execute(CheckVirtualMachineCommand cmd) { - try { - Connect conn = LibvirtConnection.getConnection(); - final State state = getVmState(conn, cmd.getVmName()); - Integer vncPort = null; - if (state == State.Running) { - vncPort = getVncPort(conn, cmd.getVmName()); - - synchronized (_vms) { - _vms.put(cmd.getVmName(), State.Running); - } - } - - return new CheckVirtualMachineAnswer(cmd, state, vncPort); - } catch (LibvirtException e) { - return new CheckVirtualMachineAnswer(cmd, e.getMessage()); - } - } - - private Answer execute(PingTestCommand cmd) { - String result = null; - final String computingHostIp = cmd.getComputingHostIp(); // TODO, split - // the - // command - // into 2 - // types - - if (computingHostIp != null) { - result = doPingTest(computingHostIp); - } else if (cmd.getRouterIp() != null && cmd.getPrivateIp() != null) { - result = doPingTest(cmd.getRouterIp(), cmd.getPrivateIp()); - } else { - return new Answer(cmd, false, "routerip and private ip is null"); - } - - if (result != null) { - return new Answer(cmd, false, result); - } - return new Answer(cmd); - } - - private String doPingTest(final String computingHostIp) { - final Script command = new Script(_pingTestPath, 10000, s_logger); - command.add("-h", computingHostIp); - return command.execute(); - } - - private String doPingTest(final String domRIp, final String vmIp) { - final Script command = new Script(_pingTestPath, 10000, s_logger); - command.add("-i", domRIp); - command.add("-p", vmIp); - return command.execute(); - } - - private synchronized Answer execute(MigrateCommand cmd) { - String vmName = cmd.getVmName(); - - State state = null; - String result = null; - synchronized (_vms) { - state = _vms.get(vmName); - _vms.put(vmName, State.Stopping); - } - - Domain dm = null; - Connect dconn = null; - Domain destDomain = null; - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - dconn = new Connect("qemu+tcp://" + cmd.getDestinationIp() - + "/system"); - /* - * Hard code lm flags: VIR_MIGRATE_LIVE(1<<0) and - * VIR_MIGRATE_PERSIST_DEST(1<<3) - */ - destDomain = dm.migrate(dconn, (1 << 0) | (1 << 3), vmName, "tcp:" - + cmd.getDestinationIp(), _migrateSpeed); - } catch (LibvirtException e) { - s_logger.debug("Can't migrate domain: " + e.getMessage()); - result = e.getMessage(); - } catch (Exception e) { - s_logger.debug("Can't migrate domain: " + e.getMessage()); - result = e.getMessage(); - } finally { - try { - if (dm != null) { - dm.free(); - } - if (dconn != null) { - dconn.close(); - } - if (destDomain != null) { - destDomain.free(); - } - } catch (final LibvirtException e) { - - } - } - - if (result != null) { - synchronized (_vms) { - _vms.put(vmName, state); - } - } else { - destroy_network_rules_for_vm(conn, vmName); - cleanupVM(conn, vmName, - getVnetId(VirtualMachineName.getVnet(vmName))); - } - - return new MigrateAnswer(cmd, result == null, result, null); - } - - private synchronized Answer execute(PrepareForMigrationCommand cmd) { - - VirtualMachineTO vm = cmd.getVirtualMachine(); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Preparing host for migrating " + vm); - } - - NicTO[] nics = vm.getNics(); - try { - Connect conn = LibvirtConnection.getConnection(); - for (NicTO nic : nics) { - String vlanId = null; - if (nic.getBroadcastType() == BroadcastDomainType.Vlan) { - URI broadcastUri = nic.getBroadcastUri(); - vlanId = broadcastUri.getHost(); - } - if (nic.getType() == TrafficType.Guest) { - if (nic.getBroadcastType() == BroadcastDomainType.Vlan - && !vlanId.equalsIgnoreCase("untagged")) { - createVlanBr(vlanId, _pifs.first()); - } - } else if (nic.getType() == TrafficType.Control) { - /* Make sure the network is still there */ - createControlNetwork(conn); - } else if (nic.getType() == TrafficType.Public) { - if (nic.getBroadcastType() == BroadcastDomainType.Vlan - && !vlanId.equalsIgnoreCase("untagged")) { - createVlanBr(vlanId, _pifs.second()); - } - } - } - - /* setup disks, e.g for iso */ - VolumeTO[] volumes = vm.getDisks(); - for (VolumeTO volume : volumes) { - if (volume.getType() == Volume.Type.ISO) { - getVolumePath(conn, volume); - } - } - - synchronized (_vms) { - _vms.put(vm.getName(), State.Migrating); - } - - return new PrepareForMigrationAnswer(cmd); - } catch (LibvirtException e) { - return new PrepareForMigrationAnswer(cmd, e.toString()); - } catch (InternalErrorException e) { - return new PrepareForMigrationAnswer(cmd, e.toString()); - } catch (URISyntaxException e) { - return new PrepareForMigrationAnswer(cmd, e.toString()); - } - } - - public void createVnet(String vnetId, String pif) - throws InternalErrorException { - final Script command = new Script(_modifyVlanPath, _timeout, s_logger); - command.add("-v", vnetId); - command.add("-p", pif); - command.add("-o", "add"); - - final String result = command.execute(); - if (result != null) { - throw new InternalErrorException("Failed to create vnet " + vnetId - + ": " + result); - } - } - - private Answer execute(CheckHealthCommand cmd) { - return new CheckHealthAnswer(cmd, true); - } - - private Answer execute(GetHostStatsCommand cmd) { - final Script cpuScript = new Script("/bin/bash", s_logger); - cpuScript.add("-c"); - cpuScript - .add("idle=$(top -b -n 1|grep Cpu\\(s\\):|cut -d% -f4|cut -d, -f2);echo $idle"); - - final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); - String result = cpuScript.execute(parser); - if (result != null) { - s_logger.debug("Unable to get the host CPU state: " + result); - return new Answer(cmd, false, result); - } - double cpuUtil = (100.0D - Double.parseDouble(parser.getLine())); - - long freeMem = 0; - final Script memScript = new Script("/bin/bash", s_logger); - memScript.add("-c"); - memScript - .add("freeMem=$(free|grep cache:|awk '{print $4}');echo $freeMem"); - final OutputInterpreter.OneLineParser Memparser = new OutputInterpreter.OneLineParser(); - result = memScript.execute(Memparser); - if (result != null) { - s_logger.debug("Unable to get the host Mem state: " + result); - return new Answer(cmd, false, result); - } - freeMem = Long.parseLong(Memparser.getLine()); - - Script totalMem = new Script("/bin/bash", s_logger); - totalMem.add("-c"); - totalMem.add("free|grep Mem:|awk '{print $2}'"); - final OutputInterpreter.OneLineParser totMemparser = new OutputInterpreter.OneLineParser(); - result = totalMem.execute(totMemparser); - if (result != null) { - s_logger.debug("Unable to get the host Mem state: " + result); - return new Answer(cmd, false, result); - } - long totMem = Long.parseLong(totMemparser.getLine()); - - Pair nicStats = getNicStats(_publicBridgeName); - - HostStatsEntry hostStats = new HostStatsEntry(cmd.getHostId(), cpuUtil, - nicStats.first() / 1000, nicStats.second() / 1000, "host", - totMem, freeMem, 0, 0); - return new GetHostStatsAnswer(cmd, hostStats); - } - - protected String networkUsage(final String privateIpAddress, - final String option, final String vif) { - Script getUsage = new Script(_networkUsagePath, s_logger); - if (option.equals("get")) { - getUsage.add("-g"); - } else if (option.equals("create")) { - getUsage.add("-c"); - } else if (option.equals("reset")) { - getUsage.add("-r"); - } else if (option.equals("addVif")) { - getUsage.add("-a", vif); - } else if (option.equals("deleteVif")) { - getUsage.add("-d", vif); - } - - getUsage.add("-i", privateIpAddress); - final OutputInterpreter.OneLineParser usageParser = new OutputInterpreter.OneLineParser(); - String result = getUsage.execute(usageParser); - if (result != null) { - s_logger.debug("Failed to execute networkUsage:" + result); - return null; - } - return usageParser.getLine(); - } - - protected long[] getNetworkStats(String privateIP) { - String result = networkUsage(privateIP, "get", null); - long[] stats = new long[2]; - if (result != null) { - String[] splitResult = result.split(":"); - int i = 0; - while (i < splitResult.length - 1) { - stats[0] += (new Long(splitResult[i++])).longValue(); - stats[1] += (new Long(splitResult[i++])).longValue(); - } - } - return stats; - } - - private Answer execute(NetworkUsageCommand cmd) { - if (cmd.getOption() != null && cmd.getOption().equals("create")) { - String result = networkUsage(cmd.getPrivateIP(), "create", null); - NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, result, 0L, - 0L); - return answer; - } - long[] stats = getNetworkStats(cmd.getPrivateIP()); - NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, "", stats[0], - stats[1]); - return answer; - } - - private Answer execute(RebootCommand cmd) { - Long bytesReceived = null; - Long bytesSent = null; - - synchronized (_vms) { - _vms.put(cmd.getVmName(), State.Starting); - } - - try { - Connect conn = LibvirtConnection.getConnection(); - final String result = rebootVM(conn, cmd.getVmName()); - if (result == null) { - Integer vncPort = null; - try { - vncPort = getVncPort(conn, cmd.getVmName()); - } catch (Exception e) { - - } - get_rule_logs_for_vms(); - return new RebootAnswer(cmd, null, bytesSent, bytesReceived, - vncPort); - } else { - return new RebootAnswer(cmd, result); - } - } catch (LibvirtException e) { - return new RebootAnswer(cmd, e.getMessage()); - } finally { - synchronized (_vms) { - _vms.put(cmd.getVmName(), State.Running); - } - } - } - - protected Answer execute(RebootRouterCommand cmd) { - Long bytesSent = 0L; - Long bytesRcvd = 0L; - if (VirtualMachineName.isValidRouterName(cmd.getVmName())) { - long[] stats = getNetworkStats(cmd.getPrivateIpAddress()); - bytesSent = stats[0]; - bytesRcvd = stats[1]; - } - RebootAnswer answer = (RebootAnswer) execute((RebootCommand) cmd); - answer.setBytesSent(bytesSent); - answer.setBytesReceived(bytesRcvd); - String result = _virtRouterResource.connect(cmd.getPrivateIpAddress()); - if (result == null) { - networkUsage(cmd.getPrivateIpAddress(), "create", null); - return answer; - } else { - return new Answer(cmd, false, result); - } - } - - protected GetVmStatsAnswer execute(GetVmStatsCommand cmd) { - List vmNames = cmd.getVmNames(); - try { - HashMap vmStatsNameMap = new HashMap(); - Connect conn = LibvirtConnection.getConnection(); - for (String vmName : vmNames) { - VmStatsEntry statEntry = getVmStat(conn, vmName); - if (statEntry == null) { - continue; - } - - vmStatsNameMap.put(vmName, statEntry); - } - return new GetVmStatsAnswer(cmd, vmStatsNameMap); - } catch (LibvirtException e) { - s_logger.debug("Can't get vm stats: " + e.toString()); - return new GetVmStatsAnswer(cmd, null); - } - } - - protected Answer execute(StopCommand cmd) { - final String vmName = cmd.getVmName(); - - Long bytesReceived = new Long(0); - Long bytesSent = new Long(0); - - State state = null; - synchronized (_vms) { - state = _vms.get(vmName); - _vms.put(vmName, State.Stopping); - } - try { - Connect conn = LibvirtConnection.getConnection(); - - List disks = getDisks(conn, vmName); - destroy_network_rules_for_vm(conn, vmName); - String result = stopVM(conn, vmName, defineOps.UNDEFINE_VM); - if (result == null) { - for (DiskDef disk : disks) { - if (disk.getDeviceType() == DiskDef.deviceType.CDROM - && disk.getDiskPath() != null) - cleanupDisk(conn, disk); - } - } - - final String result2 = cleanupVnet(conn, cmd.getVnet()); - - if (result != null && result2 != null) { - result = result2 + result; - } - state = State.Stopped; - return new StopAnswer(cmd, result, 0, bytesSent, bytesReceived); - } catch (LibvirtException e) { - return new StopAnswer(cmd, e.getMessage()); - } finally { - synchronized (_vms) { - if (state != null) { - _vms.put(vmName, state); - } else { - _vms.remove(vmName); - } - } - } - } - - protected Answer execute(ModifySshKeysCommand cmd) { - File sshKeysDir = new File(_SSHKEYSPATH); - String result = null; - if (!sshKeysDir.exists()) { - sshKeysDir.mkdir(); - // Change permissions for the 600 - Script script = new Script("chmod", _timeout, s_logger); - script.add("600", _SSHKEYSPATH); - script.execute(); - } - - File pubKeyFile = new File(_SSHPUBKEYPATH); - if (!pubKeyFile.exists()) { - try { - pubKeyFile.createNewFile(); - } catch (IOException e) { - result = "Failed to create file: " + e.toString(); - s_logger.debug(result); - } - } - - if (pubKeyFile.exists()) { - String pubKey = cmd.getPubKey(); - try { - FileOutputStream pubkStream = new FileOutputStream(pubKeyFile); - pubkStream.write(pubKey.getBytes()); - pubkStream.close(); - } catch (FileNotFoundException e) { - result = "File" + _SSHPUBKEYPATH + "is not found:" - + e.toString(); - s_logger.debug(result); - } catch (IOException e) { - result = "Write file " + _SSHPUBKEYPATH + ":" + e.toString(); - s_logger.debug(result); - } - } - - File prvKeyFile = new File(_SSHPRVKEYPATH); - if (!prvKeyFile.exists()) { - try { - prvKeyFile.createNewFile(); - } catch (IOException e) { - result = "Failed to create file: " + e.toString(); - s_logger.debug(result); - } - } - - if (prvKeyFile.exists()) { - String prvKey = cmd.getPrvKey(); - try { - FileOutputStream prvKStream = new FileOutputStream(prvKeyFile); - prvKStream.write(prvKey.getBytes()); - prvKStream.close(); - } catch (FileNotFoundException e) { - result = "File" + _SSHPRVKEYPATH + "is not found:" - + e.toString(); - s_logger.debug(result); - } catch (IOException e) { - result = "Write file " + _SSHPRVKEYPATH + ":" + e.toString(); - s_logger.debug(result); - } - - Script script = new Script("chmod", _timeout, s_logger); - script.add("600", _SSHPRVKEYPATH); - script.execute(); - } - - if (result != null) { - return new Answer(cmd, false, result); - } else { - return new Answer(cmd, true, null); - } - } - - protected void handleVmStartFailure(Connect conn, String vmName, - LibvirtVMDef vm) { - if (vm != null && vm.getDevices() != null) { - cleanupVMNetworks(conn, vm.getDevices().getInterfaces()); - } - } - - protected LibvirtVMDef createVMFromSpec(VirtualMachineTO vmTO) { - LibvirtVMDef vm = new LibvirtVMDef(); - vm.setHvsType(_hypervisorType); - vm.setDomainName(vmTO.getName()); - vm.setDomUUID(UUID.nameUUIDFromBytes(vmTO.getName().getBytes()) - .toString()); - vm.setDomDescription(vmTO.getOs()); - - GuestDef guest = new GuestDef(); - guest.setGuestType(GuestDef.guestType.KVM); - guest.setGuestArch(vmTO.getArch()); - guest.setMachineType("pc"); - guest.setBootOrder(GuestDef.bootOrder.CDROM); - guest.setBootOrder(GuestDef.bootOrder.HARDISK); - - vm.addComp(guest); - - GuestResourceDef grd = new GuestResourceDef(); - grd.setMemorySize(vmTO.getMinRam() / 1024); - grd.setVcpuNum(vmTO.getCpus()); - vm.addComp(grd); - - FeaturesDef features = new FeaturesDef(); - features.addFeatures("pae"); - features.addFeatures("apic"); - features.addFeatures("acpi"); - vm.addComp(features); - - TermPolicy term = new TermPolicy(); - term.setCrashPolicy("destroy"); - term.setPowerOffPolicy("destroy"); - term.setRebootPolicy("restart"); - vm.addComp(term); - - ClockDef clock = new ClockDef(); - if (vmTO.getOs().startsWith("Windows")) { - clock.setClockOffset(ClockDef.ClockOffset.LOCALTIME); - clock.setTimer("rtc", "catchup", null); - } - - vm.addComp(clock); - - DevicesDef devices = new DevicesDef(); - devices.setEmulatorPath(_hypervisorPath); - - SerialDef serial = new SerialDef("pty", null, (short) 0); - devices.addDevice(serial); - - ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0); - devices.addDevice(console); - - GraphicDef grap = new GraphicDef("vnc", (short) 0, true, null, null, - null); - devices.addDevice(grap); - - InputDef input = new InputDef("tablet", "usb"); - devices.addDevice(input); - - vm.addComp(devices); - - return vm; - } - - protected void createVifs(Connect conn, VirtualMachineTO vmSpec, - LibvirtVMDef vm) throws InternalErrorException, LibvirtException { - NicTO[] nics = vmSpec.getNics(); - for (int i = 0; i < nics.length; i++) { - for (NicTO nic : vmSpec.getNics()) { - if (nic.getDeviceId() == i) { - createVif(conn, vm, nic); - } - } - } - } - - protected synchronized StartAnswer execute(StartCommand cmd) { - VirtualMachineTO vmSpec = cmd.getVirtualMachine(); - String vmName = vmSpec.getName(); - LibvirtVMDef vm = null; - - State state = State.Stopped; - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - synchronized (_vms) { - _vms.put(vmName, State.Starting); - } - - vm = createVMFromSpec(vmSpec); - - createVbd(conn, vmSpec, vmName, vm); - - createVifs(conn, vmSpec, vm); - - s_logger.debug("starting " + vmName + ": " + vm.toString()); - startDomain(conn, vmName, vm.toString()); - Script.runSimpleBashScript("virsh schedinfo " + vmName - + " --set cpu_shares=" + vmSpec.getCpus() - * vmSpec.getSpeed()); - - NicTO[] nics = vmSpec.getNics(); - for (NicTO nic : nics) { - if (nic.getIsolationUri() != null - && nic.getIsolationUri().getScheme() - .equalsIgnoreCase(IsolationType.Ec2.toString())) { - if (vmSpec.getType() != VirtualMachine.Type.User) { - default_network_rules_for_systemvm(conn, vmName); - break; - } else { - default_network_rules(conn, vmName, nic, vmSpec.getId()); - } - } - } - - state = State.Running; - return new StartAnswer(cmd); - } catch (Exception e) { - s_logger.warn("Exception ", e); - if (conn != null) { - handleVmStartFailure(conn, vmName, vm); - } - return new StartAnswer(cmd, e.getMessage()); - } finally { - synchronized (_vms) { - if (state != State.Stopped) { - _vms.put(vmName, state); - } else { - _vms.remove(vmName); - } - } - } - } - - private String getVolumePath(Connect conn, VolumeTO volume) - throws LibvirtException, URISyntaxException { - if (volume.getType() == Volume.Type.ISO && volume.getPath() != null) { - String isoPath = volume.getPath(); - int index = isoPath.lastIndexOf("/"); - String path = isoPath.substring(0, index); - String name = isoPath.substring(index + 1); - KVMStoragePool secondaryPool = _storagePoolMgr - .getStoragePoolByURI(path); - KVMPhysicalDisk isoVol = secondaryPool.getPhysicalDisk(name); - return isoVol.getPath(); - } else { - return volume.getPath(); - } - } - - protected void createVbd(Connect conn, VirtualMachineTO vmSpec, - String vmName, LibvirtVMDef vm) throws InternalErrorException, - LibvirtException, URISyntaxException { - List disks = Arrays.asList(vmSpec.getDisks()); - Collections.sort(disks, new Comparator() { - @Override - public int compare(VolumeTO arg0, VolumeTO arg1) { - return arg0.getDeviceId() > arg1.getDeviceId() ? 1 : -1; - } - }); - - for (VolumeTO volume : disks) { - KVMPhysicalDisk physicalDisk = null; - KVMStoragePool pool = null; - if (volume.getType() == Volume.Type.ISO && volume.getPath() != null) { - String volPath = volume.getPath(); - int index = volPath.lastIndexOf("/"); - String volDir = volPath.substring(0, index); - String volName = volPath.substring(index + 1); - KVMStoragePool secondaryStorage = _storagePoolMgr - .getStoragePoolByURI(volDir); - physicalDisk = secondaryStorage.getPhysicalDisk(volName); - } else if (volume.getType() != Volume.Type.ISO) { - pool = _storagePoolMgr.getStoragePool(volume.getPoolUuid()); - physicalDisk = pool.getPhysicalDisk(volume.getPath()); - } - - String volPath = null; - if (physicalDisk != null) { - volPath = physicalDisk.getPath(); - } - - DiskDef.diskBus diskBusType = getGuestDiskModel(vmSpec.getOs()); - DiskDef disk = new DiskDef(); - if (volume.getType() == Volume.Type.ISO) { - if (volPath == null) { - /* Add iso as placeholder */ - disk.defISODisk(null); - } else { - disk.defISODisk(volPath); - } - } else { - int devId = (int) volume.getDeviceId(); - - if (volume.getType() == Volume.Type.DATADISK) { - disk.defFileBasedDisk(physicalDisk.getPath(), devId, - DiskDef.diskBus.VIRTIO, - DiskDef.diskFmtType.QCOW2); - } else { - disk.defFileBasedDisk(physicalDisk.getPath(), devId, - diskBusType, DiskDef.diskFmtType.QCOW2); - } - - } - - vm.getDevices().addDevice(disk); - } - - if (vmSpec.getType() != VirtualMachine.Type.User) { - if (_sysvmISOPath != null) { - DiskDef iso = new DiskDef(); - iso.defISODisk(_sysvmISOPath); - vm.getDevices().addDevice(iso); - } - - createPatchVbd(conn, vmName, vm, vmSpec); - } - } - - private VolumeTO getVolume(VirtualMachineTO vmSpec, Volume.Type type) { - VolumeTO volumes[] = vmSpec.getDisks(); - for (VolumeTO volume : volumes) { - if (volume.getType() == type) { - return volume; - } - } - return null; - } - - private void createPatchVbd(Connect conn, String vmName, LibvirtVMDef vm, - VirtualMachineTO vmSpec) throws LibvirtException, - InternalErrorException { - - List disks = vm.getDevices().getDisks(); - DiskDef rootDisk = disks.get(0); - VolumeTO rootVol = getVolume(vmSpec, Volume.Type.ROOT); - KVMStoragePool pool = _storagePoolMgr.getStoragePool(rootVol - .getPoolUuid()); - KVMPhysicalDisk disk = pool.createPhysicalDisk(UUID.randomUUID() - .toString(), KVMPhysicalDisk.PhysicalDiskFormat.RAW, - 10L * 1024 * 1024); - /* Format/create fs on this disk */ - final Script command = new Script(_createvmPath, _timeout, s_logger); - command.add("-f", disk.getPath()); - String result = command.execute(); - if (result != null) { - s_logger.debug("Failed to create data disk: " + result); - throw new InternalErrorException("Failed to create data disk: " - + result); - } - String datadiskPath = disk.getPath(); - - /* add patch disk */ - DiskDef patchDisk = new DiskDef(); - - patchDisk.defFileBasedDisk(datadiskPath, 1, rootDisk.getBusType(), - DiskDef.diskFmtType.RAW); - - disks.add(patchDisk); - - String bootArgs = vmSpec.getBootArgs(); - - patchSystemVm(bootArgs, datadiskPath, vmName); - } - - private String createVlanBr(String vlanId, String nic) - throws InternalErrorException { - String brName = setVnetBrName(vlanId); - createVnet(vlanId, nic); - return brName; - } - - private InterfaceDef createVif(Connect conn, NicTO nic, - InterfaceDef.nicModel model) throws InternalErrorException, - LibvirtException { - InterfaceDef intf = new InterfaceDef(); - - String vlanId = null; - if (nic.getBroadcastType() == BroadcastDomainType.Vlan) { - URI broadcastUri = nic.getBroadcastUri(); - vlanId = broadcastUri.getHost(); - } - - if (nic.getType() == TrafficType.Guest) { - if (nic.getBroadcastType() == BroadcastDomainType.Vlan - && !vlanId.equalsIgnoreCase("untagged")) { - String brName = createVlanBr(vlanId, _pifs.first()); - intf.defBridgeNet(brName, null, nic.getMac(), model); - } else { - intf.defBridgeNet(_guestBridgeName, null, nic.getMac(), model); - } - } else if (nic.getType() == TrafficType.Control) { - /* Make sure the network is still there */ - createControlNetwork(conn); - intf.defBridgeNet(_linkLocalBridgeName, null, nic.getMac(), model); - } else if (nic.getType() == TrafficType.Public) { - if (nic.getBroadcastType() == BroadcastDomainType.Vlan - && !vlanId.equalsIgnoreCase("untagged")) { - String brName = createVlanBr(vlanId, _pifs.second()); - intf.defBridgeNet(brName, null, nic.getMac(), model); - } else { - intf.defBridgeNet(_publicBridgeName, null, nic.getMac(), model); - } - } else if (nic.getType() == TrafficType.Management) { - intf.defBridgeNet(_privBridgeName, null, nic.getMac(), model); - } else if (nic.getType() == TrafficType.Storage) { - String storageBrName = nic.getName() == null ? _privBridgeName - : nic.getName(); - intf.defBridgeNet(storageBrName, null, nic.getMac(), model); - } - - return intf; - } - - private void createVif(Connect conn, LibvirtVMDef vm, NicTO nic) - throws InternalErrorException, LibvirtException { - vm.getDevices().addDevice( - createVif(conn, nic, getGuestNicModel(vm.getGuestOSType()))); - } - - protected CheckSshAnswer execute(CheckSshCommand cmd) { - String vmName = cmd.getName(); - String privateIp = cmd.getIp(); - int cmdPort = cmd.getPort(); - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Ping command port, " + privateIp + ":" + cmdPort); - } - - try { - String result = _virtRouterResource.connect(privateIp, cmdPort); - if (result != null) { - return new CheckSshAnswer(cmd, "Can not ping System vm " - + vmName + "due to:" + result); - } - } catch (Exception e) { - return new CheckSshAnswer(cmd, e); - } - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Ping command port succeeded for vm " + vmName); - } - - return new CheckSshAnswer(cmd); - } - - private boolean cleanupDisk(Connect conn, DiskDef disk) { - // need to umount secondary storage - String path = disk.getDiskPath(); - String poolUuid = null; - if (path != null) { - String[] token = path.split("/"); - if (token.length > 3) { - poolUuid = token[2]; - } - } - - if (poolUuid == null) { - return true; - } - - try { - KVMStoragePool pool = _storagePoolMgr.getStoragePool(poolUuid); - if (pool != null) { - pool.delete(); - } - return true; - } catch (CloudRuntimeException e) { - return false; - } - } - - protected synchronized String attachOrDetachISO(Connect conn, - String vmName, String isoPath, boolean isAttach) - throws LibvirtException, URISyntaxException, InternalErrorException { - String isoXml = null; - if (isoPath != null && isAttach) { - int index = isoPath.lastIndexOf("/"); - String path = isoPath.substring(0, index); - String name = isoPath.substring(index + 1); - KVMStoragePool secondaryPool = _storagePoolMgr - .getStoragePoolByURI(path); - KVMPhysicalDisk isoVol = secondaryPool.getPhysicalDisk(name); - isoPath = isoVol.getPath(); - - DiskDef iso = new DiskDef(); - iso.defISODisk(isoPath); - isoXml = iso.toString(); - } else { - DiskDef iso = new DiskDef(); - iso.defISODisk(null); - isoXml = iso.toString(); - } - - List disks = getDisks(conn, vmName); - String result = attachOrDetachDevice(conn, true, vmName, isoXml); - if (result == null && !isAttach) { - for (DiskDef disk : disks) { - if (disk.getDeviceType() == DiskDef.deviceType.CDROM) { - cleanupDisk(conn, disk); - } - } - - } - return result; - } - - protected synchronized String attachOrDetachDisk(Connect conn, - boolean attach, String vmName, KVMPhysicalDisk attachingDisk, - int devId) throws LibvirtException, InternalErrorException { - List disks = null; - Domain dm = null; - DiskDef diskdef = null; - try { - if (!attach) { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); - String xml = dm.getXMLDesc(0); - parser.parseDomainXML(xml); - disks = parser.getDisks(); - - for (DiskDef disk : disks) { - String file = disk.getDiskPath(); - if (file != null - && file.equalsIgnoreCase(attachingDisk.getPath())) { - diskdef = disk; - break; - } - } - if (diskdef == null) { - throw new InternalErrorException("disk: " - + attachingDisk.getPath() - + " is not attached before"); - } - } else { - diskdef = new DiskDef(); - if (attachingDisk.getFormat() == PhysicalDiskFormat.QCOW2) { - diskdef.defFileBasedDisk(attachingDisk.getPath(), devId, - DiskDef.diskBus.VIRTIO, DiskDef.diskFmtType.QCOW2); - } else if (attachingDisk.getFormat() == PhysicalDiskFormat.RAW) { - diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId, - DiskDef.diskBus.VIRTIO); - } - } - - String xml = diskdef.toString(); - return attachOrDetachDevice(conn, attach, vmName, xml); - } finally { - if (dm != null) { - dm.free(); - } - } - } - - protected synchronized String attachOrDetachDevice(Connect conn, - boolean attach, String vmName, String xml) throws LibvirtException, - InternalErrorException { - Domain dm = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes((vmName - .getBytes()))); - - if (attach) { - s_logger.debug("Attaching device: " + xml); - dm.attachDevice(xml); - } else { - s_logger.debug("Detaching device: " + xml); - dm.detachDevice(xml); - } - } catch (LibvirtException e) { - if (attach) { - s_logger.warn("Failed to attach device to " + vmName + ": " - + e.getMessage()); - } else { - s_logger.warn("Failed to detach device from " + vmName + ": " - + e.getMessage()); - } - throw e; - } catch (Exception e) { - throw new InternalErrorException(e.toString()); - } finally { - if (dm != null) { - try { - dm.free(); - } catch (LibvirtException l) { - - } - } - } - - return null; - } - - @Override - public PingCommand getCurrentStatus(long id) { - final HashMap newStates = sync(); - - if (!_can_bridge_firewall) { - return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, - newStates); - } else { - HashMap> nwGrpStates = syncNetworkGroups(id); - return new PingRoutingWithNwGroupsCommand(getType(), id, newStates, - nwGrpStates); - } - } - - @Override - public Type getType() { - return Type.Routing; - } - - private Map getVersionStrings() { - final Script command = new Script(_versionstringpath, _timeout, - s_logger); - KeyValueInterpreter kvi = new KeyValueInterpreter(); - String result = command.execute(kvi); - if (result == null) { - return kvi.getKeyValues(); - } else { - return new HashMap(1); - } - } - - @Override - public StartupCommand[] initialize() { - Map changes = null; - - synchronized (_vms) { - _vms.clear(); - changes = sync(); - } - - final List info = getHostInfo(); - - final StartupRoutingCommand cmd = new StartupRoutingCommand( - (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), - (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, - RouterPrivateIpStrategy.HostLocal); - cmd.setStateChanges(changes); - fillNetworkInformation(cmd); - _privateIp = cmd.getPrivateIpAddress(); - cmd.getHostDetails().putAll(getVersionStrings()); - cmd.setPool(_pool); - cmd.setCluster(_clusterId); - cmd.setGatewayIpAddress(_localGateway); - - StartupStorageCommand sscmd = null; - try { - - KVMStoragePool localStoragePool = _storagePoolMgr - .createStoragePool(_localStorageUUID, "localhost", - _localStoragePath, StoragePoolType.Filesystem); - com.cloud.agent.api.StoragePoolInfo pi = new com.cloud.agent.api.StoragePoolInfo( - localStoragePool.getUuid(), cmd.getPrivateIpAddress(), - _localStoragePath, _localStoragePath, - StoragePoolType.Filesystem, localStoragePool.getCapacity(), - localStoragePool.getUsed()); - - sscmd = new StartupStorageCommand(); - sscmd.setPoolInfo(pi); - sscmd.setGuid(pi.getUuid()); - sscmd.setDataCenter(_dcId); - sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); - } catch (CloudRuntimeException e) { - - } - - if (sscmd != null) { - return new StartupCommand[] { cmd, sscmd }; - } else { - return new StartupCommand[] { cmd }; - } - } - - protected HashMap sync() { - HashMap newStates; - HashMap oldStates = null; - - final HashMap changes = new HashMap(); - - synchronized (_vms) { - newStates = getAllVms(); - if (newStates == null) { - s_logger.debug("Unable to get the vm states so no state sync at this point."); - return changes; - } - - oldStates = new HashMap(_vms.size()); - oldStates.putAll(_vms); - - for (final Map.Entry entry : newStates.entrySet()) { - final String vm = entry.getKey(); - - State newState = entry.getValue(); - final State oldState = oldStates.remove(vm); - - if (newState == State.Stopped && oldState != State.Stopping - && oldState != null && oldState != State.Stopped) { - newState = getRealPowerState(vm); - } - - if (s_logger.isTraceEnabled()) { - s_logger.trace("VM " + vm + ": libvirt has state " - + newState + " and we have state " - + (oldState != null ? oldState.toString() : "null")); - } - - if (vm.startsWith("migrating")) { - s_logger.debug("Migration detected. Skipping"); - continue; - } - if (oldState == null) { - _vms.put(vm, newState); - s_logger.debug("Detecting a new state but couldn't find a old state so adding it to the changes: " - + vm); - changes.put(vm, newState); - } else if (oldState == State.Starting) { - if (newState == State.Running) { - _vms.put(vm, newState); - } else if (newState == State.Stopped) { - s_logger.debug("Ignoring vm " + vm - + " because of a lag in starting the vm."); - } - } else if (oldState == State.Migrating) { - if (newState == State.Running) { - s_logger.debug("Detected that an migrating VM is now running: " - + vm); - _vms.put(vm, newState); - } - } else if (oldState == State.Stopping) { - if (newState == State.Stopped) { - _vms.put(vm, newState); - } else if (newState == State.Running) { - s_logger.debug("Ignoring vm " + vm - + " because of a lag in stopping the vm. "); - } - } else if (oldState != newState) { - _vms.put(vm, newState); - if (newState == State.Stopped) { - if (_vmsKilled.remove(vm)) { - s_logger.debug("VM " + vm - + " has been killed for storage. "); - newState = State.Error; - } - } - changes.put(vm, newState); - } - } - - for (final Map.Entry entry : oldStates.entrySet()) { - final String vm = entry.getKey(); - final State oldState = entry.getValue(); - - if (s_logger.isTraceEnabled()) { - s_logger.trace("VM " - + vm - + " is now missing from libvirt so reporting stopped"); - } - - if (oldState == State.Stopping) { - s_logger.debug("Ignoring VM " + vm - + " in transition state stopping."); - _vms.remove(vm); - } else if (oldState == State.Starting) { - s_logger.debug("Ignoring VM " + vm - + " in transition state starting."); - } else if (oldState == State.Stopped) { - _vms.remove(vm); - } else if (oldState == State.Migrating) { - s_logger.debug("Ignoring VM " + vm + " in migrating state."); - } else { - _vms.remove(vm); - State state = State.Stopped; - if (_vmsKilled.remove(entry.getKey())) { - s_logger.debug("VM " + vm - + " has been killed by storage monitor"); - state = State.Error; - } - changes.put(entry.getKey(), state); - } - } - } - - return changes; - } - - protected State getRealPowerState(String vm) { - int i = 0; - s_logger.trace("Checking on the HALTED State"); - Domain dm = null; - for (; i < 5; i++) { - try { - Connect conn = LibvirtConnection.getConnection(); - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vm - .getBytes())); - DomainInfo.DomainState vps = dm.getInfo().state; - if (vps != null - && vps != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF - && vps != DomainInfo.DomainState.VIR_DOMAIN_NOSTATE) { - return convertToState(vps); - } - } catch (final LibvirtException e) { - s_logger.trace(e.getMessage()); - } catch (Exception e) { - s_logger.trace(e.getMessage()); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (final LibvirtException e) { - - } - } - - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - } - } - return State.Stopped; - } - - protected List getAllVmNames(Connect conn) { - ArrayList la = new ArrayList(); - try { - final String names[] = conn.listDefinedDomains(); - for (int i = 0; i < names.length; i++) { - la.add(names[i]); - } - } catch (final LibvirtException e) { - s_logger.warn("Failed to list Defined domains", e); - } - - int[] ids = null; - try { - ids = conn.listDomains(); - } catch (final LibvirtException e) { - s_logger.warn("Failed to list domains", e); - return la; - } - - Domain dm = null; - for (int i = 0; i < ids.length; i++) { - try { - dm = conn.domainLookupByID(ids[i]); - la.add(dm.getName()); - } catch (final LibvirtException e) { - s_logger.warn("Unable to get vms", e); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (final LibvirtException e) { - - } - } - } - - return la; - } - - private HashMap getAllVms() { - final HashMap vmStates = new HashMap(); - - String[] vms = null; - int[] ids = null; - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - } catch (LibvirtException e) { - s_logger.debug("Failed to get connection: " + e.getMessage()); - return vmStates; - } - - try { - ids = conn.listDomains(); - } catch (final LibvirtException e) { - s_logger.warn("Unable to listDomains", e); - return null; - } - try { - vms = conn.listDefinedDomains(); - } catch (final LibvirtException e) { - s_logger.warn("Unable to listDomains", e); - return null; - } - - Domain dm = null; - for (int i = 0; i < ids.length; i++) { - try { - dm = conn.domainLookupByID(ids[i]); - - DomainInfo.DomainState ps = dm.getInfo().state; - - final State state = convertToState(ps); - - s_logger.trace("VM " + dm.getName() + ": powerstate = " + ps - + "; vm state=" + state.toString()); - String vmName = dm.getName(); - vmStates.put(vmName, state); - } catch (final LibvirtException e) { - s_logger.warn("Unable to get vms", e); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException e) { - - } - } - } - - for (int i = 0; i < vms.length; i++) { - try { - - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vms[i] - .getBytes())); - - DomainInfo.DomainState ps = dm.getInfo().state; - final State state = convertToState(ps); - String vmName = dm.getName(); - s_logger.trace("VM " + vmName + ": powerstate = " + ps - + "; vm state=" + state.toString()); - - vmStates.put(vmName, state); - } catch (final LibvirtException e) { - s_logger.warn("Unable to get vms", e); - } catch (Exception e) { - s_logger.warn("Unable to get vms", e); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException e) { - - } - } - } - - return vmStates; - } - - protected List getHostInfo() { - final ArrayList info = new ArrayList(); - long speed = 0; - long cpus = 0; - long ram = 0; - String cap = null; - try { - Connect conn = LibvirtConnection.getConnection(); - final NodeInfo hosts = conn.nodeInfo(); - boolean result = false; - try { - BufferedReader in = new BufferedReader( - new FileReader( - "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")); - speed = Long.parseLong(in.readLine()) / 1000; - result = true; - } catch (FileNotFoundException e) { - - } catch (IOException e) { - - } catch (NumberFormatException e) { - - } - - if (!result) { - speed = hosts.mhz; - } - - cpus = hosts.cpus; - ram = hosts.memory * 1024L; - LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); - parser.parseCapabilitiesXML(conn.getCapabilities()); - ArrayList oss = parser.getGuestOsType(); - for (String s : oss) { - /* - * Even host supports guest os type more than hvm, we only - * report hvm to management server - */ - if (s.equalsIgnoreCase("hvm")) { - cap = "hvm"; - } - } - } catch (LibvirtException e) { - - } - - if (isSnapshotSupported()) { - cap = cap + ",snapshot"; - } - - info.add((int) cpus); - info.add(speed); - info.add(ram); - info.add(cap); - long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L);// save a maximum - // of 10% of - // system ram or - // 768M - dom0ram = Math.max(dom0ram, _dom0MinMem); - info.add(dom0ram); - s_logger.debug("cpus=" + cpus + ", speed=" + speed + ", ram=" + ram - + ", dom0ram=" + dom0ram); - - return info; - } - - protected void cleanupVM(Connect conn, final String vmName, - final String vnet) { - s_logger.debug("Trying to cleanup the vnet: " + vnet); - if (vnet != null) { - cleanupVnet(conn, vnet); - } - - _vmStats.remove(vmName); - } - - protected String rebootVM(Connect conn, String vmName) { - Domain dm = null; - String msg = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - String vmDef = dm.getXMLDesc(0); - s_logger.debug(vmDef); - msg = stopVM(conn, vmName, defineOps.UNDEFINE_VM); - msg = startDomain(conn, vmName, vmDef); - return null; - } catch (LibvirtException e) { - s_logger.warn("Failed to create vm", e); - msg = e.getMessage(); - } catch (Exception e) { - s_logger.warn("Failed to create vm", e); - msg = e.getMessage(); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException e) { - - } - } - - return msg; - } - - protected String stopVM(Connect conn, String vmName, defineOps df) { - DomainInfo.DomainState state = null; - Domain dm = null; - - s_logger.debug("Try to stop the vm at first"); - String ret = stopVM(conn, vmName, false); - if (ret == Script.ERR_TIMEOUT) { - ret = stopVM(conn, vmName, true); - } else if (ret != null) { - /* - * There is a race condition between libvirt and qemu: libvirt - * listens on qemu's monitor fd. If qemu is shutdown, while libvirt - * is reading on the fd, then libvirt will report an error. - */ - /* Retry 3 times, to make sure we can get the vm's status */ - for (int i = 0; i < 3; i++) { - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - state = dm.getInfo().state; - break; - } catch (LibvirtException e) { - s_logger.debug("Failed to get vm status:" + e.getMessage()); - } catch (Exception e) { - s_logger.debug("Failed to get vm status:" + e.getMessage()); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException l) { - - } - } - } - - if (state == null) { - s_logger.debug("Can't get vm's status, assume it's dead already"); - return null; - } - - if (state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) { - s_logger.debug("Try to destroy the vm"); - ret = stopVM(conn, vmName, true); - if (ret != null) { - return ret; - } - } - } - - if (df == defineOps.UNDEFINE_VM) { - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - dm.undefine(); - } catch (LibvirtException e) { - - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException l) { - - } - } - } - return null; - } - - protected String stopVM(Connect conn, String vmName, boolean force) { - Domain dm = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - if (force) { - if (dm.getInfo().state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) { - dm.destroy(); - } - } else { - if (dm.getInfo().state == DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) { - return null; - } - dm.shutdown(); - int retry = _stopTimeout / 2000; - /* Wait for the domain gets into shutoff state */ - while ((dm.getInfo().state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) - && (retry >= 0)) { - Thread.sleep(2000); - retry--; - } - if (retry < 0) { - s_logger.warn("Timed out waiting for domain " + vmName - + " to shutdown gracefully"); - return Script.ERR_TIMEOUT; - } - } - } catch (LibvirtException e) { - s_logger.debug("Failed to stop VM :" + vmName + " :", e); - return e.getMessage(); - } catch (InterruptedException ie) { - s_logger.debug("Interrupted sleep"); - return ie.getMessage(); - } catch (Exception e) { - s_logger.debug("Failed to stop VM :" + vmName + " :", e); - return e.getMessage(); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException e) { - } - } - - return null; - } - - public synchronized String cleanupVnet(Connect conn, final String vnetId) { - // VNC proxy VMs do not have vnet - if (vnetId == null || vnetId.isEmpty() - || isDirectAttachedNetwork(vnetId)) { - return null; - } - - final List names = getAllVmNames(conn); - - if (!names.isEmpty()) { - for (final String name : names) { - if (VirtualMachineName.getVnet(name).equals(vnetId)) { - return null; // Can't remove the vnet yet. - } - } - } - - final Script command = new Script(_modifyVlanPath, _timeout, s_logger); - command.add("-o", "delete"); - command.add("-v", vnetId); - return command.execute(); - } - - protected Integer getVncPort(Connect conn, String vmName) - throws LibvirtException { - LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); - Domain dm = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - String xmlDesc = dm.getXMLDesc(0); - parser.parseDomainXML(xmlDesc); - return parser.getVncPort(); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException l) { - - } - } - } - - private boolean IsHVMEnabled(Connect conn) { - LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); - try { - parser.parseCapabilitiesXML(conn.getCapabilities()); - ArrayList osTypes = parser.getGuestOsType(); - for (String o : osTypes) { - if (o.equalsIgnoreCase("hvm")) { - return true; - } - } - } catch (LibvirtException e) { - - } - return false; - } - - private String getHypervisorPath(Connect conn) { - File f = new File("/usr/bin/cloud-qemu-kvm"); - if (f.exists()) { - return "/usr/bin/cloud-qemu-kvm"; - } else { - f = new File("/usr/libexec/cloud-qemu-kvm"); - if (f.exists()) { - return "/usr/libexec/cloud-qemu-kvm"; - } - - LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); - try { - parser.parseCapabilitiesXML(conn.getCapabilities()); - } catch (LibvirtException e) { - - } - return parser.getEmulator(); - } - } - - private String getGuestType(Connect conn, String vmName) { - LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); - Domain dm = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - String xmlDesc = dm.getXMLDesc(0); - parser.parseDomainXML(xmlDesc); - return parser.getDescription(); - } catch (LibvirtException e) { - return null; - } catch (Exception e) { - return null; - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException l) { - - } - } - } - - private boolean isGuestPVEnabled(String guestOS) { - if (guestOS == null) { - return false; - } - String guestOSName = KVMGuestOsMapper.getGuestOsName(guestOS); - if (guestOS.startsWith("Ubuntu") - || guestOSName.startsWith("Fedora 13") - || guestOSName.startsWith("Fedora 12") - || guestOSName.startsWith("Fedora 11") - || guestOSName.startsWith("Fedora 10") - || guestOSName.startsWith("Fedora 9") - || guestOSName.startsWith("CentOS 5.3") - || guestOSName.startsWith("CentOS 5.4") - || guestOSName.startsWith("CentOS 5.5") - || guestOS.startsWith("CentOS") - || guestOS.startsWith("Fedora") - || guestOSName.startsWith("Red Hat Enterprise Linux 5.3") - || guestOSName.startsWith("Red Hat Enterprise Linux 5.4") - || guestOSName.startsWith("Red Hat Enterprise Linux 5.5") - || guestOSName.startsWith("Red Hat Enterprise Linux 6") - || guestOS.startsWith("Debian GNU/Linux") - || guestOSName.startsWith("Other PV")) { - return true; - } else { - return false; - } - } - - public boolean isCentosHost() { - if (_hvVersion <= 9) { - return true; - } else { - return false; - } - } - - private InterfaceDef.nicModel getGuestNicModel(String guestOSType) { - if (isGuestPVEnabled(guestOSType)) { - return InterfaceDef.nicModel.VIRTIO; - } else { - return InterfaceDef.nicModel.E1000; - } - } - - private DiskDef.diskBus getGuestDiskModel(String guestOSType) { - if (isGuestPVEnabled(guestOSType)) { - return DiskDef.diskBus.VIRTIO; - } else { - return DiskDef.diskBus.IDE; - } - } - - private String setVnetBrName(String vnetId) { - return "cloudVirBr" + vnetId; - } - - private String getVnetIdFromBrName(String vnetBrName) { - return vnetBrName.replaceAll("cloudVirBr", ""); - } - - private void cleanupVMNetworks(Connect conn, List nics) { - for (InterfaceDef nic : nics) { - if (nic.getHostNetType() == hostNicType.VNET) { - cleanupVnet(conn, getVnetIdFromBrName(nic.getBrName())); - } - } - } - - private Domain getDomain(Connect conn, String vmName) - throws LibvirtException { - return conn - .domainLookupByUUID(UUID.nameUUIDFromBytes(vmName.getBytes())); - } - - protected List getInterfaces(Connect conn, String vmName) { - LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); - Domain dm = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - parser.parseDomainXML(dm.getXMLDesc(0)); - return parser.getInterfaces(); - - } catch (LibvirtException e) { - s_logger.debug("Failed to get dom xml: " + e.toString()); - return new ArrayList(); - } catch (Exception e) { - s_logger.debug("Failed to get dom xml: " + e.toString()); - return new ArrayList(); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException e) { - - } - } - } - - protected List getDisks(Connect conn, String vmName) { - LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); - Domain dm = null; - try { - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); - parser.parseDomainXML(dm.getXMLDesc(0)); - return parser.getDisks(); - - } catch (LibvirtException e) { - s_logger.debug("Failed to get dom xml: " + e.toString()); - return new ArrayList(); - } catch (Exception e) { - s_logger.debug("Failed to get dom xml: " + e.toString()); - return new ArrayList(); - } finally { - try { - if (dm != null) { - dm.free(); - } - } catch (LibvirtException e) { - - } - } - } - - private String executeBashScript(String script) { - Script command = new Script("/bin/bash", _timeout, s_logger); - command.add("-c"); - command.add(script); - return command.execute(); - } - - private String executeBashScript(String script, OutputInterpreter parser) { - Script command = new Script("/bin/bash", _timeout, s_logger); - command.add("-c"); - command.add(script); - return command.execute(parser); - } - - private void deletExitingLinkLocalRoutTable(String linkLocalBr) { - Script command = new Script("/bin/bash", _timeout); - command.add("-c"); - command.add("ip route | grep " + NetUtils.getLinkLocalCIDR()); - OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser(); - String result = command.execute(parser); - boolean foundLinkLocalBr = false; - if (result == null && parser.getLines() != null) { - String[] lines = parser.getLines().split("\\n"); - for (String line : lines) { - String[] tokens = line.split(" "); - if (!tokens[2].equalsIgnoreCase(linkLocalBr)) { - Script.runSimpleBashScript("ip route del " - + NetUtils.getLinkLocalCIDR()); - } else { - foundLinkLocalBr = true; - } - } - } - if (!foundLinkLocalBr) { - Script.runSimpleBashScript("ip route add " - + NetUtils.getLinkLocalCIDR() + " dev " + linkLocalBr - + " src " + NetUtils.getLinkLocalGateway()); - } - } - - private class vmStats { - long _usedTime; - long _tx; - long _rx; - Calendar _timestamp; - } - - private VmStatsEntry getVmStat(Connect conn, String vmName) - throws LibvirtException { - Domain dm = null; - try { - dm = getDomain(conn, vmName); - DomainInfo info = dm.getInfo(); - - VmStatsEntry stats = new VmStatsEntry(); - stats.setNumCPUs(info.nrVirtCpu); - stats.setEntityType("vm"); - - /* get cpu utilization */ - vmStats oldStats = null; - - Calendar now = Calendar.getInstance(); - - oldStats = _vmStats.get(vmName); - - long elapsedTime = 0; - if (oldStats != null) { - elapsedTime = now.getTimeInMillis() - - oldStats._timestamp.getTimeInMillis(); - double utilization = (info.cpuTime - oldStats._usedTime) - / ((double) elapsedTime * 1000000); - - NodeInfo node = conn.nodeInfo(); - utilization = utilization / node.cpus; - stats.setCPUUtilization(utilization * 100); - } - - /* get network stats */ - - List vifs = getInterfaces(conn, vmName); - long rx = 0; - long tx = 0; - for (InterfaceDef vif : vifs) { - DomainInterfaceStats ifStats = dm.interfaceStats(vif - .getDevName()); - rx += ifStats.rx_bytes; - tx += ifStats.tx_bytes; - } - - if (oldStats != null) { - long deltarx = rx - oldStats._rx; - if (deltarx > 0) - stats.setNetworkReadKBs(deltarx / 1000); - long deltatx = tx - oldStats._tx; - if (deltatx > 0) - stats.setNetworkWriteKBs(deltatx / 1000); - } - - vmStats newStat = new vmStats(); - newStat._usedTime = info.cpuTime; - newStat._rx = rx; - newStat._tx = tx; - newStat._timestamp = now; - _vmStats.put(vmName, newStat); - return stats; - } finally { - if (dm != null) { - dm.free(); - } - } - } - - private boolean can_bridge_firewall(String prvNic) { - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("can_bridge_firewall"); - cmd.add(prvNic); - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - protected boolean destroy_network_rules_for_vm(Connect conn, String vmName) { - if (!_can_bridge_firewall) { - return false; - } - String vif = null; - List intfs = getInterfaces(conn, vmName); - if (intfs.size() > 0) { - InterfaceDef intf = intfs.get(0); - vif = intf.getDevName(); - } - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("destroy_network_rules_for_vm"); - cmd.add("--vmname", vmName); - if (vif != null) { - cmd.add("--vif", vif); - } - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - protected boolean default_network_rules(Connect conn, String vmName, - NicTO nic, Long vmId) { - if (!_can_bridge_firewall) { - return false; - } - - List intfs = getInterfaces(conn, vmName); - if (intfs.size() < nic.getDeviceId()) { - return false; - } - - InterfaceDef intf = intfs.get(nic.getDeviceId()); - String brname = intf.getBrName(); - String vif = intf.getDevName(); - - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("default_network_rules"); - cmd.add("--vmname", vmName); - cmd.add("--vmid", vmId.toString()); - if (nic.getIp() != null) { - cmd.add("--vmip", nic.getIp()); - } - cmd.add("--vmmac", nic.getMac()); - cmd.add("--vif", vif); - cmd.add("--brname", brname); - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - protected boolean post_default_network_rules(Connect conn, String vmName, - NicTO nic, Long vmId, InetAddress dhcpServerIp, String hostIp, - String hostMacAddr) { - if (!_can_bridge_firewall) { - return false; - } - - List intfs = getInterfaces(conn, vmName); - if (intfs.size() < nic.getDeviceId()) { - return false; - } - - InterfaceDef intf = intfs.get(nic.getDeviceId()); - String brname = intf.getBrName(); - String vif = intf.getDevName(); - - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("post_default_network_rules"); - cmd.add("--vmname", vmName); - cmd.add("--vmid", vmId.toString()); - cmd.add("--vmip", nic.getIp()); - cmd.add("--vmmac", nic.getMac()); - cmd.add("--vif", vif); - cmd.add("--brname", brname); - if (dhcpServerIp != null) - cmd.add("--dhcpSvr", dhcpServerIp.getHostAddress()); - - cmd.add("--hostIp", hostIp); - cmd.add("--hostMacAddr", hostMacAddr); - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - protected boolean default_network_rules_for_systemvm(Connect conn, - String vmName) { - if (!_can_bridge_firewall) { - return false; - } - List intfs = getInterfaces(conn, vmName); - if (intfs.size() < 1) { - return false; - } - /* FIX ME: */ - String brname = null; - if (vmName.startsWith("r-")) { - InterfaceDef intf = intfs.get(0); - brname = intf.getBrName(); - } else { - InterfaceDef intf = intfs.get(intfs.size() - 1); - brname = intf.getBrName(); - } - - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("default_network_rules_systemvm"); - cmd.add("--vmname", vmName); - cmd.add("--brname", brname); - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - private boolean add_network_rules(String vmName, String vmId, - String guestIP, String sig, String seq, String mac, String rules, - String vif, String brname) { - if (!_can_bridge_firewall) { - return false; - } - - String newRules = rules.replace(" ", ";"); - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("add_network_rules"); - cmd.add("--vmname", vmName); - cmd.add("--vmid", vmId); - cmd.add("--vmip", guestIP); - cmd.add("--sig", sig); - cmd.add("--seq", seq); - cmd.add("--vmmac", mac); - cmd.add("--vif", vif); - cmd.add("--brname", brname); - if (rules != null) { - cmd.add("--rules", newRules); - } - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - private boolean cleanup_rules() { - if (!_can_bridge_firewall) { - return false; - } - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("cleanup_rules"); - String result = cmd.execute(); - if (result != null) { - return false; - } - return true; - } - - private String get_rule_logs_for_vms() { - Script cmd = new Script(_securityGroupPath, _timeout, s_logger); - cmd.add("get_rule_logs_for_vms"); - OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); - String result = cmd.execute(parser); - if (result == null) { - return parser.getLine(); - } - return null; - } - - private HashMap> syncNetworkGroups(long id) { - HashMap> states = new HashMap>(); - - String result = get_rule_logs_for_vms(); - s_logger.trace("syncNetworkGroups: id=" + id + " got: " + result); - String[] rulelogs = result != null ? result.split(";") : new String[0]; - for (String rulesforvm : rulelogs) { - String[] log = rulesforvm.split(","); - if (log.length != 6) { - continue; - } - try { - states.put(log[0], new Pair(Long.parseLong(log[1]), - Long.parseLong(log[5]))); - } catch (NumberFormatException nfe) { - states.put(log[0], new Pair(-1L, -1L)); - } - } - return states; - } - - /* online snapshot supported by enhanced qemu-kvm */ - private boolean isSnapshotSupported() { - String result = executeBashScript("qemu-img --help|grep convert |grep snapshot"); - if (result != null) { - return false; - } else { - return true; - } - } - - private Pair getNicStats(String nicName) { - double rx = 0.0; - OutputInterpreter.OneLineParser rxParser = new OutputInterpreter.OneLineParser(); - String result = executeBashScript("cat /sys/class/net/" + nicName - + "/statistics/rx_bytes", rxParser); - if (result == null && rxParser.getLine() != null) { - rx = Double.parseDouble(rxParser.getLine()); - } - - double tx = 0.0; - OutputInterpreter.OneLineParser txParser = new OutputInterpreter.OneLineParser(); - result = executeBashScript("cat /sys/class/net/" + nicName - + "/statistics/tx_bytes", txParser); - if (result == null && txParser.getLine() != null) { - tx = Double.parseDouble(txParser.getLine()); - } - - return new Pair(rx, tx); - } - - private void createControlNetwork(Connect conn) throws LibvirtException { - _virtRouterResource.createControlNetwork(_linkLocalBridgeName); - } - - private Answer execute(NetworkRulesSystemVmCommand cmd) { - boolean success = false; - Connect conn; - try { - conn = LibvirtConnection.getConnection(); - success = default_network_rules_for_systemvm(conn, cmd.getVmName()); - } catch (LibvirtException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return new Answer(cmd, success, ""); - } + ServerResource { + private static final Logger s_logger = Logger + .getLogger(LibvirtComputingResource.class); + + private String _modifyVlanPath; + private String _versionstringpath; + private String _patchdomrPath; + private String _createvmPath; + private String _manageSnapshotPath; + private String _createTmplPath; + private String _heartBeatPath; + private String _securityGroupPath; + private String _networkUsagePath; + private String _host; + private String _dcId; + private String _pod; + private String _clusterId; + private int _migrateSpeed; + + private long _hvVersion; + private KVMHAMonitor _monitor; + private final String _SSHKEYSPATH = "/root/.ssh"; + private final String _SSHPRVKEYPATH = _SSHKEYSPATH + File.separator + + "id_rsa.cloud"; + private final String _SSHPUBKEYPATH = _SSHKEYSPATH + File.separator + + "id_rsa.pub.cloud"; + private String _mountPoint = "/mnt"; + StorageLayer _storage; + private KVMStoragePoolManager _storagePoolMgr; + + private static final class KeyValueInterpreter extends OutputInterpreter { + private final Map map = new HashMap(); + + @Override + public String interpret(BufferedReader reader) throws IOException { + String line = null; + int numLines = 0; + while ((line = reader.readLine()) != null) { + String[] toks = line.trim().split("="); + if (toks.length < 2) { + s_logger.warn("Failed to parse Script output: " + line); + } else { + map.put(toks[0].trim(), toks[1].trim()); + } + numLines++; + } + if (numLines == 0) { + s_logger.warn("KeyValueInterpreter: no output lines?"); + } + return null; + } + + public Map getKeyValues() { + return map; + } + } + + @Override + protected String getDefaultScriptsDir() { + return null; + } + + protected static MessageFormat SnapshotXML = new MessageFormat( + " " + " {0}" + " " + + " {1}" + " " + + " "); + + protected String _hypervisorType; + protected String _hypervisorURI; + protected String _hypervisorPath; + protected String _sysvmISOPath; + protected String _privNwName; + protected String _privBridgeName; + protected String _linkLocalBridgeName; + protected String _publicBridgeName; + protected String _guestBridgeName; + protected String _privateIp; + protected String _pool; + protected String _localGateway; + private boolean _can_bridge_firewall; + protected String _localStoragePath; + protected String _localStorageUUID; + private Pair _pifs; + private final Map _vmStats = new ConcurrentHashMap(); + + protected boolean _disconnected = true; + protected int _timeout; + protected int _cmdsTimeout; + protected int _stopTimeout; + protected static HashMap s_statesTable; + static { + s_statesTable = new HashMap(); + s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, + State.Stopped); + s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_PAUSED, + State.Running); + s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_RUNNING, + State.Running); + s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_BLOCKED, + State.Running); + s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_NOSTATE, + State.Unknown); + s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTDOWN, + State.Stopping); + } + + protected HashMap _vms = new HashMap(20); + protected List _vmsKilled = new ArrayList(); + + private VirtualRoutingResource _virtRouterResource; + + private String _pingTestPath; + + private int _dom0MinMem; + + protected enum defineOps { + UNDEFINE_VM, DEFINE_VM + } + + private String getEndIpFromStartIp(String startIp, int numIps) { + String[] tokens = startIp.split("[.]"); + assert (tokens.length == 4); + int lastbyte = Integer.parseInt(tokens[3]); + lastbyte = lastbyte + numIps; + tokens[3] = Integer.toString(lastbyte); + StringBuilder end = new StringBuilder(15); + end.append(tokens[0]).append(".").append(tokens[1]).append(".") + .append(tokens[2]).append(".").append(tokens[3]); + return end.toString(); + } + + private Map getDeveloperProperties() + throws ConfigurationException { + final File file = PropertiesUtil.findConfigFile("developer.properties"); + if (file == null) { + throw new ConfigurationException( + "Unable to find developer.properties."); + } + + s_logger.info("developer.properties found at " + file.getAbsolutePath()); + Properties properties = new Properties(); + try { + properties.load(new FileInputStream(file)); + + String startMac = (String) properties.get("private.macaddr.start"); + if (startMac == null) { + throw new ConfigurationException( + "Developers must specify start mac for private ip range"); + } + + String startIp = (String) properties.get("private.ipaddr.start"); + if (startIp == null) { + throw new ConfigurationException( + "Developers must specify start ip for private ip range"); + } + final Map params = PropertiesUtil.toMap(properties); + + String endIp = (String) properties.get("private.ipaddr.end"); + if (endIp == null) { + endIp = getEndIpFromStartIp(startIp, 16); + params.put("private.ipaddr.end", endIp); + } + return params; + } catch (final FileNotFoundException ex) { + throw new CloudRuntimeException("Cannot find the file: " + + file.getAbsolutePath(), ex); + } catch (final IOException ex) { + throw new CloudRuntimeException("IOException in reading " + + file.getAbsolutePath(), ex); + } + } + + protected String getDefaultNetworkScriptsDir() { + return "scripts/vm/network/vnet"; + } + + protected String getDefaultStorageScriptsDir() { + return "scripts/storage/qcow2"; + } + + private void saveProperties(Map params) + throws ConfigurationException { + final File file = PropertiesUtil.findConfigFile("agent.properties"); + if (file == null) { + throw new ConfigurationException("Unable to find agent.properties."); + } + + s_logger.info("agent.properties found at " + file.getAbsolutePath()); + + try { + Properties _properties = new Properties(); + _properties.load(new FileInputStream(file)); + Set names = _properties.stringPropertyNames(); + for (String key : params.keySet()) { + if (!names.contains(key)) { + _properties.setProperty(key, (String) params.get(key)); + } + } + _properties.store(new FileOutputStream(file), ""); + } catch (final FileNotFoundException ex) { + throw new CloudRuntimeException("Cannot find the file: " + + file.getAbsolutePath(), ex); + } catch (final IOException ex) { + throw new CloudRuntimeException("IOException in reading " + + file.getAbsolutePath(), ex); + } + } + + @Override + public boolean configure(String name, Map params) + throws ConfigurationException { + boolean success = super.configure(name, params); + if (!success) { + return false; + } + + try { + Class clazz = Class + .forName("com.cloud.storage.JavaStorageLayer"); + _storage = (StorageLayer) ComponentLocator.inject(clazz); + _storage.configure("StorageLayer", params); + } catch (ClassNotFoundException e) { + throw new ConfigurationException("Unable to find class " + + "com.cloud.storage.JavaStorageLayer"); + } + + _virtRouterResource = new VirtualRoutingResource(); + + // Set the domr scripts directory + params.put("domr.scripts.dir", "scripts/network/domr/kvm"); + + success = _virtRouterResource.configure(name, params); + + String kvmScriptsDir = (String) params.get("kvm.scripts.dir"); + if (kvmScriptsDir == null) { + kvmScriptsDir = "scripts/vm/hypervisor/kvm"; + } + + String networkScriptsDir = (String) params.get("network.scripts.dir"); + if (networkScriptsDir == null) { + networkScriptsDir = getDefaultNetworkScriptsDir(); + } + + String storageScriptsDir = (String) params.get("storage.scripts.dir"); + if (storageScriptsDir == null) { + storageScriptsDir = getDefaultStorageScriptsDir(); + } + + if (!success) { + return false; + } + + _host = (String) params.get("host"); + if (_host == null) { + _host = "localhost"; + } + + _dcId = (String) params.get("zone"); + if (_dcId == null) { + _dcId = "default"; + } + + _pod = (String) params.get("pod"); + if (_pod == null) { + _pod = "default"; + } + + _clusterId = (String) params.get("cluster"); + + _modifyVlanPath = Script.findScript(networkScriptsDir, "modifyvlan.sh"); + if (_modifyVlanPath == null) { + throw new ConfigurationException("Unable to find modifyvlan.sh"); + } + + _versionstringpath = Script.findScript(kvmScriptsDir, "versions.sh"); + if (_versionstringpath == null) { + throw new ConfigurationException("Unable to find versions.sh"); + } + + _patchdomrPath = Script.findScript(kvmScriptsDir + "/patch/", + "rundomrpre.sh"); + if (_patchdomrPath == null) { + throw new ConfigurationException("Unable to find rundomrpre.sh"); + } + + _heartBeatPath = Script.findScript(kvmScriptsDir, "kvmheartbeat.sh"); + if (_heartBeatPath == null) { + throw new ConfigurationException("Unable to find kvmheartbeat.sh"); + } + + _createvmPath = Script.findScript(storageScriptsDir, "createvm.sh"); + if (_createvmPath == null) { + throw new ConfigurationException("Unable to find the createvm.sh"); + } + + _manageSnapshotPath = Script.findScript(storageScriptsDir, + "managesnapshot.sh"); + if (_manageSnapshotPath == null) { + throw new ConfigurationException( + "Unable to find the managesnapshot.sh"); + } + + _createTmplPath = Script + .findScript(storageScriptsDir, "createtmplt.sh"); + if (_createTmplPath == null) { + throw new ConfigurationException( + "Unable to find the createtmplt.sh"); + } + + _securityGroupPath = Script.findScript(networkScriptsDir, + "security_group.py"); + if (_securityGroupPath == null) { + throw new ConfigurationException( + "Unable to find the security_group.py"); + } + + _networkUsagePath = Script.findScript("scripts/network/domr/", + "networkUsage.sh"); + if (_networkUsagePath == null) { + throw new ConfigurationException( + "Unable to find the networkUsage.sh"); + } + + String value = (String) params.get("developer"); + boolean isDeveloper = Boolean.parseBoolean(value); + + if (isDeveloper) { + params.putAll(getDeveloperProperties()); + } + + _pool = (String) params.get("pool"); + if (_pool == null) { + _pool = "/root"; + } + + String instance = (String) params.get("instance"); + + _hypervisorType = (String) params.get("hypervisor.type"); + if (_hypervisorType == null) { + _hypervisorType = "kvm"; + } + + _hypervisorURI = (String) params.get("hypervisor.uri"); + if (_hypervisorURI == null) { + _hypervisorURI = "qemu:///system"; + } + String startMac = (String) params.get("private.macaddr.start"); + if (startMac == null) { + startMac = "00:16:3e:77:e2:a0"; + } + + String startIp = (String) params.get("private.ipaddr.start"); + if (startIp == null) { + startIp = "192.168.166.128"; + } + + _pingTestPath = Script.findScript(kvmScriptsDir, "pingtest.sh"); + if (_pingTestPath == null) { + throw new ConfigurationException("Unable to find the pingtest.sh"); + } + + _linkLocalBridgeName = (String) params.get("private.bridge.name"); + if (_linkLocalBridgeName == null) { + if (isDeveloper) { + _linkLocalBridgeName = "cloud-" + instance + "-0"; + } else { + _linkLocalBridgeName = "cloud0"; + } + } + + _publicBridgeName = (String) params.get("public.network.device"); + if (_publicBridgeName == null) { + _publicBridgeName = "cloudbr0"; + } + + _privBridgeName = (String) params.get("private.network.device"); + if (_privBridgeName == null) { + _privBridgeName = "cloudbr1"; + } + + _guestBridgeName = (String) params.get("guest.network.device"); + if (_guestBridgeName == null) { + _guestBridgeName = _privBridgeName; + } + + _privNwName = (String) params.get("private.network.name"); + if (_privNwName == null) { + if (isDeveloper) { + _privNwName = "cloud-" + instance + "-private"; + } else { + _privNwName = "cloud-private"; + } + } + + _localStoragePath = (String) params.get("local.storage.path"); + if (_localStoragePath == null) { + _localStoragePath = "/var/lib/libvirt/images/"; + } + + _localStorageUUID = (String) params.get("local.storage.uuid"); + if (_localStorageUUID == null) { + _localStorageUUID = UUID.randomUUID().toString(); + params.put("local.storage.uuid", _localStorageUUID); + } + + value = (String) params.get("scripts.timeout"); + _timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000; + + value = (String) params.get("stop.script.timeout"); + _stopTimeout = NumbersUtil.parseInt(value, 120) * 1000; + + value = (String) params.get("cmds.timeout"); + _cmdsTimeout = NumbersUtil.parseInt(value, 7200) * 1000; + + value = (String) params.get("host.reserved.mem.mb"); + _dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024; + + value = (String) params.get("debug.mode"); + + LibvirtConnection.initialize(_hypervisorURI); + Connect conn = null; + try { + conn = LibvirtConnection.getConnection(); + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.getMessage()); + } + + /* Does node support HVM guest? If not, exit */ + if (!IsHVMEnabled(conn)) { + throw new ConfigurationException( + "NO HVM support on this machine, pls make sure: " + + "1. VT/SVM is supported by your CPU, or is enabled in BIOS. " + + "2. kvm modules is installed"); + } + + _hypervisorPath = getHypervisorPath(conn); + try { + _hvVersion = conn.getVersion(); + _hvVersion = (_hvVersion % 1000000) / 1000; + } catch (LibvirtException e) { + + } + + String[] info = NetUtils.getNetworkParams(_privateNic); + + _monitor = new KVMHAMonitor(null, info[0], _heartBeatPath); + Thread ha = new Thread(_monitor); + ha.start(); + + _storagePoolMgr = new KVMStoragePoolManager(_storage, _monitor); + + _sysvmISOPath = (String) params.get("systemvm.iso.path"); + if (_sysvmISOPath == null) { + String[] isoPaths = { "/usr/lib64/cloud/agent/vms/systemvm.iso", + "/usr/lib/cloud/agent/vms/systemvm.iso" }; + for (String isoPath : isoPaths) { + if (_storage.exists(isoPath)) { + _sysvmISOPath = isoPath; + break; + } + } + if (_sysvmISOPath == null) { + s_logger.debug("Can't find system vm ISO"); + } + } + + try { + createControlNetwork(conn); + } catch (LibvirtException e) { + throw new ConfigurationException(e.getMessage()); + } + + _pifs = getPifs(); + if (_pifs.first() == null) { + s_logger.debug("Failed to get private nic name"); + throw new ConfigurationException("Failed to get private nic name"); + } + + if (_pifs.second() == null) { + s_logger.debug("Failed to get public nic name"); + throw new ConfigurationException("Failed to get public nic name"); + } + s_logger.debug("Found pif: " + _pifs.first() + " on " + _privBridgeName + + ", pif: " + _pifs.second() + " on " + _publicBridgeName); + + _can_bridge_firewall = can_bridge_firewall(_pifs.second()); + + _localGateway = Script + .runSimpleBashScript("ip route |grep default|awk '{print $3}'"); + if (_localGateway == null) { + s_logger.debug("Failed to found the local gateway"); + } + + _mountPoint = (String) params.get("mount.path"); + if (_mountPoint == null) { + _mountPoint = "/mnt"; + } + + value = (String) params.get("vm.migrate.speed"); + _migrateSpeed = NumbersUtil.parseInt(value, -1); + if (_migrateSpeed == -1) { + //get guest network device speed + _migrateSpeed = 0; + String speed = Script.runSimpleBashScript("ethtool " + _pifs.second() + " |grep Speed | cut -d \\ -f 2"); + if (speed != null) { + String[] tokens = speed.split("M"); + if (tokens.length == 2) { + try { + _migrateSpeed = Integer.parseInt(tokens[0]); + } catch (Exception e) { + + } + s_logger.debug("device " + _pifs.second() + " has speed: " + String.valueOf(_migrateSpeed)); + } + } + params.put("vm.migrate.speed", String.valueOf(_migrateSpeed)); + } + saveProperties(params); + + return true; + } + + private Pair getPifs() { + /* get pifs from bridge */ + String pubPif = null; + String privPif = null; + String vlan = null; + if (_publicBridgeName != null) { + pubPif = Script.runSimpleBashScript("brctl show | grep " + + _publicBridgeName + " | awk '{print $4}'"); + vlan = Script.runSimpleBashScript("ls /proc/net/vlan/" + pubPif); + if (vlan != null && !vlan.isEmpty()) { + pubPif = Script + .runSimpleBashScript("grep ^Device\\: /proc/net/vlan/" + + pubPif + " | awk {'print $2'}"); + } + } + if (_guestBridgeName != null) { + privPif = Script.runSimpleBashScript("brctl show | grep " + + _guestBridgeName + " | awk '{print $4}'"); + vlan = Script.runSimpleBashScript("ls /proc/net/vlan/" + privPif); + if (vlan != null && !vlan.isEmpty()) { + privPif = Script + .runSimpleBashScript("grep ^Device\\: /proc/net/vlan/" + + privPif + " | awk {'print $2'}"); + } + } + return new Pair(privPif, pubPif); + } + + private boolean checkNetwork(String networkName) { + if (networkName == null) { + return true; + } + + String name = Script.runSimpleBashScript("brctl show | grep " + + networkName + " | awk '{print $4}'"); + if (name == null) { + return false; + } else { + return true; + } + } + + private String getVnetId(String vnetId) { + return vnetId; + } + + private void patchSystemVm(String cmdLine, String dataDiskPath, + String vmName) throws InternalErrorException { + String result; + final Script command = new Script(_patchdomrPath, _timeout, s_logger); + command.add("-l", vmName); + command.add("-t", "all"); + command.add("-d", dataDiskPath); + command.add("-p", cmdLine.replaceAll(" ", "%")); + result = command.execute(); + if (result != null) { + throw new InternalErrorException(result); + } + } + + boolean isDirectAttachedNetwork(String type) { + if ("untagged".equalsIgnoreCase(type)) { + return true; + } else { + try { + Long.valueOf(type); + } catch (NumberFormatException e) { + return true; + } + return false; + } + } + + protected String startDomain(Connect conn, String vmName, String domainXML) + throws LibvirtException, InternalErrorException { + /* No duplicated vm, we will success, or failed */ + boolean failed = false; + Domain dm = null; + try { + dm = conn.domainDefineXML(domainXML); + } catch (final LibvirtException e) { + /* Duplicated defined vm */ + s_logger.warn("Failed to define domain " + vmName + ": " + + e.getMessage()); + failed = true; + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (final LibvirtException e) { + + } + } + + /* If failed, undefine the vm */ + Domain dmOld = null; + Domain dmNew = null; + try { + if (failed) { + dmOld = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + dmOld.undefine(); + dmNew = conn.domainDefineXML(domainXML); + } + } catch (final LibvirtException e) { + s_logger.warn("Failed to define domain (second time) " + vmName + + ": " + e.getMessage()); + throw e; + } catch (Exception e) { + s_logger.warn("Failed to define domain (second time) " + vmName + + ": " + e.getMessage()); + throw new InternalErrorException(e.toString()); + } finally { + try { + if (dmOld != null) { + dmOld.free(); + } + if (dmNew != null) { + dmNew.free(); + } + } catch (final LibvirtException e) { + + } + } + + /* Start the VM */ + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + dm.create(); + } catch (LibvirtException e) { + s_logger.warn("Failed to start domain: " + vmName + ": " + + e.getMessage()); + throw e; + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (final LibvirtException e) { + + } + } + return null; + } + + @Override + public boolean stop() { + try { + Connect conn = LibvirtConnection.getConnection(); + conn.close(); + } catch (LibvirtException e) { + } + + return true; + } + + public static void main(String[] args) { + s_logger.addAppender(new org.apache.log4j.ConsoleAppender( + new org.apache.log4j.PatternLayout(), "System.out")); + LibvirtComputingResource test = new LibvirtComputingResource(); + Map params = new HashMap(); + try { + test.configure("test", params); + } catch (ConfigurationException e) { + System.out.println(e.getMessage()); + e.printStackTrace(); + } + String result = null; + // String result = test.startDomainRouter("domr1", + // "/var/lib/images/centos.5-4.x86-64/centos-small.img", 128, "0064", + // "02:00:30:00:01:01", "00:16:3e:77:e2:a1", "02:00:30:00:64:01"); + boolean created = (result == null); + s_logger.info("Domain " + (created ? " " : " not ") + " created"); + + s_logger.info("Rule " + (created ? " " : " not ") + " created"); + test.stop(); + } + + @Override + public Answer executeRequest(Command cmd) { + + try { + if (cmd instanceof StopCommand) { + return execute((StopCommand) cmd); + } else if (cmd instanceof GetVmStatsCommand) { + return execute((GetVmStatsCommand) cmd); + } else if (cmd instanceof RebootRouterCommand) { + return execute((RebootRouterCommand) cmd); + } else if (cmd instanceof RebootCommand) { + return execute((RebootCommand) cmd); + } else if (cmd instanceof GetHostStatsCommand) { + return execute((GetHostStatsCommand) cmd); + } else if (cmd instanceof CheckStateCommand) { + return executeRequest(cmd); + } else if (cmd instanceof CheckHealthCommand) { + return execute((CheckHealthCommand) cmd); + } else if (cmd instanceof PrepareForMigrationCommand) { + return execute((PrepareForMigrationCommand) cmd); + } else if (cmd instanceof MigrateCommand) { + return execute((MigrateCommand) cmd); + } else if (cmd instanceof PingTestCommand) { + return execute((PingTestCommand) cmd); + } else if (cmd instanceof CheckVirtualMachineCommand) { + return execute((CheckVirtualMachineCommand) cmd); + } else if (cmd instanceof ReadyCommand) { + return execute((ReadyCommand) cmd); + } else if (cmd instanceof AttachIsoCommand) { + return execute((AttachIsoCommand) cmd); + } else if (cmd instanceof AttachVolumeCommand) { + return execute((AttachVolumeCommand) cmd); + } else if (cmd instanceof StopCommand) { + return execute((StopCommand) cmd); + } else if (cmd instanceof CheckConsoleProxyLoadCommand) { + return execute((CheckConsoleProxyLoadCommand) cmd); + } else if (cmd instanceof WatchConsoleProxyLoadCommand) { + return execute((WatchConsoleProxyLoadCommand) cmd); + } else if (cmd instanceof GetVncPortCommand) { + return execute((GetVncPortCommand) cmd); + } else if (cmd instanceof ModifySshKeysCommand) { + return execute((ModifySshKeysCommand) cmd); + } else if (cmd instanceof MaintainCommand) { + return execute((MaintainCommand) cmd); + } else if (cmd instanceof CreateCommand) { + return execute((CreateCommand) cmd); + } else if (cmd instanceof DestroyCommand) { + return execute((DestroyCommand) cmd); + } else if (cmd instanceof PrimaryStorageDownloadCommand) { + return execute((PrimaryStorageDownloadCommand) cmd); + } else if (cmd instanceof CreatePrivateTemplateFromVolumeCommand) { + return execute((CreatePrivateTemplateFromVolumeCommand) cmd); + } else if (cmd instanceof GetStorageStatsCommand) { + return execute((GetStorageStatsCommand) cmd); + } else if (cmd instanceof ManageSnapshotCommand) { + return execute((ManageSnapshotCommand) cmd); + } else if (cmd instanceof BackupSnapshotCommand) { + return execute((BackupSnapshotCommand) cmd); + } else if (cmd instanceof CreateVolumeFromSnapshotCommand) { + return execute((CreateVolumeFromSnapshotCommand) cmd); + } else if (cmd instanceof CreatePrivateTemplateFromSnapshotCommand) { + return execute((CreatePrivateTemplateFromSnapshotCommand) cmd); + } else if (cmd instanceof UpgradeSnapshotCommand) { + return execute((UpgradeSnapshotCommand) cmd); + } else if (cmd instanceof CreateStoragePoolCommand) { + return execute((CreateStoragePoolCommand) cmd); + } else if (cmd instanceof ModifyStoragePoolCommand) { + return execute((ModifyStoragePoolCommand) cmd); + } else if (cmd instanceof SecurityGroupRulesCmd) { + return execute((SecurityGroupRulesCmd) cmd); + } else if (cmd instanceof DeleteStoragePoolCommand) { + return execute((DeleteStoragePoolCommand) cmd); + } else if (cmd instanceof FenceCommand) { + return execute((FenceCommand) cmd); + } else if (cmd instanceof StartCommand) { + return execute((StartCommand) cmd); + } else if (cmd instanceof IpAssocCommand) { + return execute((IpAssocCommand) cmd); + } else if (cmd instanceof NetworkElementCommand) { + return _virtRouterResource.executeRequest(cmd); + } else if (cmd instanceof CheckSshCommand) { + return execute((CheckSshCommand) cmd); + } else if (cmd instanceof NetworkUsageCommand) { + return execute((NetworkUsageCommand) cmd); + } else if (cmd instanceof NetworkRulesSystemVmCommand) { + return execute((NetworkRulesSystemVmCommand) cmd); + } else if (cmd instanceof CleanupNetworkRulesCmd) { + return execute((CleanupNetworkRulesCmd) cmd); + } else if (cmd instanceof CopyVolumeCommand) { + return execute((CopyVolumeCommand) cmd); + } else if (cmd instanceof CheckNetworkCommand) { + return execute((CheckNetworkCommand) cmd); + } else { + s_logger.warn("Unsupported command "); + return Answer.createUnsupportedCommandAnswer(cmd); + } + } catch (final IllegalArgumentException e) { + return new Answer(cmd, false, e.getMessage()); + } + } + + private CheckNetworkAnswer execute(CheckNetworkCommand cmd) { + List phyNics = cmd + .getPhysicalNetworkInfoList(); + String errMsg = null; + for (PhysicalNetworkSetupInfo nic : phyNics) { + if (!checkNetwork(nic.getGuestNetworkName())) { + errMsg = "Can not find network: " + nic.getGuestNetworkName(); + break; + } else if (!checkNetwork(nic.getPrivateNetworkName())) { + errMsg = "Can not find network: " + nic.getPrivateNetworkName(); + break; + } else if (!checkNetwork(nic.getPublicNetworkName())) { + errMsg = "Can not find network: " + nic.getPublicNetworkName(); + break; + } + } + + if (errMsg != null) { + return new CheckNetworkAnswer(cmd, false, errMsg); + } else { + return new CheckNetworkAnswer(cmd, true, null); + } + } + + private CopyVolumeAnswer execute(CopyVolumeCommand cmd) { + boolean copyToSecondary = cmd.toSecondaryStorage(); + String volumePath = cmd.getVolumePath(); + StorageFilerTO pool = cmd.getPool(); + String secondaryStorageUrl = cmd.getSecondaryStorageURL(); + KVMStoragePool secondaryStoragePool = null; + try { + KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(pool + .getUuid()); + String volumeName = UUID.randomUUID().toString(); + + if (copyToSecondary) { + String destVolumeName = volumeName + ".qcow2"; + KVMPhysicalDisk volume = primaryPool.getPhysicalDisk(cmd + .getVolumePath()); + String volumeDestPath = "/volumes/" + cmd.getVolumeId() + + File.separator; + secondaryStoragePool = _storagePoolMgr + .getStoragePoolByURI(secondaryStorageUrl); + secondaryStoragePool.createFolder(volumeDestPath); + secondaryStoragePool.delete(); + secondaryStoragePool = _storagePoolMgr + .getStoragePoolByURI(secondaryStorageUrl + + volumeDestPath); + _storagePoolMgr.copyPhysicalDisk(volume, destVolumeName, + secondaryStoragePool); + return new CopyVolumeAnswer(cmd, true, null, null, volumeName); + } else { + volumePath = "/volumes/" + cmd.getVolumeId() + File.separator; + secondaryStoragePool = _storagePoolMgr + .getStoragePoolByURI(secondaryStorageUrl + volumePath); + KVMPhysicalDisk volume = secondaryStoragePool + .getPhysicalDisk(cmd.getVolumePath() + ".qcow2"); + _storagePoolMgr.copyPhysicalDisk(volume, volumeName, + primaryPool); + return new CopyVolumeAnswer(cmd, true, null, null, volumeName); + } + } catch (CloudRuntimeException e) { + return new CopyVolumeAnswer(cmd, false, e.toString(), null, null); + } finally { + if (secondaryStoragePool != null) { + secondaryStoragePool.delete(); + } + } + } + + protected Answer execute(DeleteStoragePoolCommand cmd) { + try { + _storagePoolMgr.deleteStoragePool(cmd.getPool().getUuid()); + return new Answer(cmd); + } catch (CloudRuntimeException e) { + return new Answer(cmd, false, e.toString()); + } + } + + protected FenceAnswer execute(FenceCommand cmd) { + ExecutorService executors = Executors.newSingleThreadExecutor(); + List pools = _monitor.getStoragePools(); + KVMHAChecker ha = new KVMHAChecker(pools, cmd.getHostIp()); + Future future = executors.submit(ha); + try { + Boolean result = future.get(); + if (result) { + return new FenceAnswer(cmd, false, "Heart is still beating..."); + } else { + return new FenceAnswer(cmd); + } + } catch (InterruptedException e) { + s_logger.warn("Unable to fence", e); + return new FenceAnswer(cmd, false, e.getMessage()); + } catch (ExecutionException e) { + s_logger.warn("Unable to fence", e); + return new FenceAnswer(cmd, false, e.getMessage()); + } + + } + + protected Storage.StorageResourceType getStorageResourceType() { + return Storage.StorageResourceType.STORAGE_POOL; + } + + protected Answer execute(CreateCommand cmd) { + StorageFilerTO pool = cmd.getPool(); + DiskProfile dskch = cmd.getDiskCharacteristics(); + KVMPhysicalDisk BaseVol = null; + KVMStoragePool primaryPool = null; + KVMPhysicalDisk vol = null; + long disksize; + try { + primaryPool = _storagePoolMgr.getStoragePool(pool.getUuid()); + + if (cmd.getTemplateUrl() != null) { + + BaseVol = primaryPool.getPhysicalDisk(cmd.getTemplateUrl()); + vol = _storagePoolMgr.createDiskFromTemplate(BaseVol, UUID + .randomUUID().toString(), primaryPool); + + if (vol == null) { + return new Answer(cmd, false, + " Can't create storage volume on storage pool"); + } + disksize = vol.getSize(); + } else { + disksize = dskch.getSize(); + vol = primaryPool.createPhysicalDisk(UUID.randomUUID() + .toString(), dskch.getSize()); + } + VolumeTO volume = new VolumeTO(cmd.getVolumeId(), dskch.getType(), + pool.getType(), pool.getUuid(), pool.getPath(), + vol.getName(), vol.getName(), disksize, null); + return new CreateAnswer(cmd, volume); + } catch (CloudRuntimeException e) { + s_logger.debug("Failed to create volume: " + e.toString()); + return new CreateAnswer(cmd, e); + } + } + + public Answer execute(DestroyCommand cmd) { + VolumeTO vol = cmd.getVolume(); + + try { + KVMStoragePool pool = _storagePoolMgr.getStoragePool(vol + .getPoolUuid()); + pool.deletePhysicalDisk(vol.getPath()); + + return new Answer(cmd, true, "Success"); + } catch (CloudRuntimeException e) { + s_logger.debug("Failed to delete volume: " + e.toString()); + return new Answer(cmd, false, e.toString()); + } + } + + private String getVlanIdFromBridge(String brName) { + OutputInterpreter.OneLineParser vlanIdParser = new OutputInterpreter.OneLineParser(); + final Script cmd = new Script("/bin/bash", s_logger); + cmd.add("-c"); + cmd.add("vlanid=$(brctl show |grep " + brName + + " |awk '{print $4}' | cut -s -d. -f 2);echo $vlanid"); + String result = cmd.execute(vlanIdParser); + if (result != null) { + return null; + } + String vlanId = vlanIdParser.getLine(); + if (vlanId.equalsIgnoreCase("")) { + return null; + } else { + return vlanId; + } + } + + private void VifHotPlug(Connect conn, String vmName, String vlanId, + String macAddr) throws InternalErrorException, LibvirtException { + NicTO nicTO = new NicTO(); + nicTO.setMac(macAddr); + nicTO.setType(TrafficType.Public); + if (vlanId == null) { + nicTO.setBroadcastType(BroadcastDomainType.Native); + } else { + nicTO.setBroadcastType(BroadcastDomainType.Vlan); + nicTO.setBroadcastUri(BroadcastDomainType.Vlan.toUri(vlanId)); + } + + InterfaceDef nic = createVif(conn, nicTO, InterfaceDef.nicModel.VIRTIO); + Domain vm = getDomain(conn, vmName); + vm.attachDevice(nic.toString()); + } + + public Answer execute(IpAssocCommand cmd) { + String routerName = cmd + .getAccessDetail(NetworkElementCommand.ROUTER_NAME); + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + String[] results = new String[cmd.getIpAddresses().length]; + Connect conn; + try { + conn = LibvirtConnection.getConnection(); + List nics = getInterfaces(conn, routerName); + Map vlanAllocatedToVM = new HashMap(); + Integer nicPos = 0; + for (InterfaceDef nic : nics) { + if (nic.getBrName().equalsIgnoreCase(_linkLocalBridgeName)) { + vlanAllocatedToVM.put("LinkLocal", nicPos); + } else { + String vlanId = getVlanIdFromBridge(nic.getBrName()); + if (vlanId != null) { + vlanAllocatedToVM.put(vlanId, nicPos); + } else { + vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos); + } + } + nicPos++; + } + IpAddressTO[] ips = cmd.getIpAddresses(); + int i = 0; + String result = null; + int nicNum = 0; + for (IpAddressTO ip : ips) { + if (!vlanAllocatedToVM.containsKey(ip.getVlanId())) { + /* plug a vif into router */ + VifHotPlug(conn, routerName, ip.getVlanId(), + ip.getVifMacAddress()); + vlanAllocatedToVM.put(ip.getVlanId(), nicPos++); + } + nicNum = vlanAllocatedToVM.get(ip.getVlanId()); + networkUsage(routerIp, "addVif", "eth" + nicNum); + result = _virtRouterResource.assignPublicIpAddress(routerName, + routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), + ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), + ip.getVlanNetmask(), ip.getVifMacAddress(), + ip.getGuestIp(), nicNum); + + if (result != null) { + results[i++] = IpAssocAnswer.errorResult; + } else { + results[i++] = ip.getPublicIp() + " - success"; + ; + } + } + return new IpAssocAnswer(cmd, results); + } catch (LibvirtException e) { + return new IpAssocAnswer(cmd, results); + } catch (InternalErrorException e) { + return new IpAssocAnswer(cmd, results); + } + } + + protected ManageSnapshotAnswer execute(final ManageSnapshotCommand cmd) { + String snapshotName = cmd.getSnapshotName(); + String snapshotPath = cmd.getSnapshotPath(); + String vmName = cmd.getVmName(); + try { + Connect conn = LibvirtConnection.getConnection(); + DomainInfo.DomainState state = null; + Domain vm = null; + if (vmName != null) { + try { + vm = getDomain(conn, cmd.getVmName()); + state = vm.getInfo().state; + } catch (LibvirtException e) { + + } + } + + KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd + .getPool().getUuid()); + KVMPhysicalDisk disk = primaryPool.getPhysicalDisk(cmd + .getVolumePath()); + if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING + && !primaryPool.isExternalSnapshot()) { + String vmUuid = vm.getUUIDString(); + Object[] args = new Object[] { snapshotName, vmUuid }; + String snapshot = SnapshotXML.format(args); + s_logger.debug(snapshot); + if (cmd.getCommandSwitch().equalsIgnoreCase( + ManageSnapshotCommand.CREATE_SNAPSHOT)) { + vm.snapshotCreateXML(snapshot); + } else { + DomainSnapshot snap = vm.snapshotLookupByName(snapshotName); + snap.delete(0); + } + + /* + * libvirt on RHEL6 doesn't handle resume event emitted from + * qemu + */ + vm = getDomain(conn, cmd.getVmName()); + state = vm.getInfo().state; + if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) { + vm.resume(); + } + } else { + + /* VM is not running, create a snapshot by ourself */ + final Script command = new Script(_manageSnapshotPath, + _cmdsTimeout, s_logger); + if (cmd.getCommandSwitch().equalsIgnoreCase( + ManageSnapshotCommand.CREATE_SNAPSHOT)) { + command.add("-c", disk.getPath()); + } else { + command.add("-d", snapshotPath); + } + + command.add("-n", snapshotName); + String result = command.execute(); + if (result != null) { + s_logger.debug("Failed to manage snapshot: " + result); + return new ManageSnapshotAnswer(cmd, false, + "Failed to manage snapshot: " + result); + } + } + return new ManageSnapshotAnswer(cmd, cmd.getSnapshotId(), + disk.getPath() + File.separator + snapshotName, true, null); + } catch (LibvirtException e) { + s_logger.debug("Failed to manage snapshot: " + e.toString()); + return new ManageSnapshotAnswer(cmd, false, + "Failed to manage snapshot: " + e.toString()); + } + + } + + protected BackupSnapshotAnswer execute(final BackupSnapshotCommand cmd) { + Long dcId = cmd.getDataCenterId(); + Long accountId = cmd.getAccountId(); + Long volumeId = cmd.getVolumeId(); + String secondaryStoragePoolUrl = cmd.getSecondaryStorageUrl(); + String snapshotName = cmd.getSnapshotName(); + String snapshotPath = cmd.getVolumePath(); + String snapshotDestPath = null; + String snapshotRelPath = null; + String vmName = cmd.getVmName(); + KVMStoragePool secondaryStoragePool = null; + try { + Connect conn = LibvirtConnection.getConnection(); + + secondaryStoragePool = _storagePoolMgr + .getStoragePoolByURI(secondaryStoragePoolUrl); + + String ssPmountPath = secondaryStoragePool.getLocalPath(); + snapshotRelPath = File.separator + "snapshots" + File.separator + + dcId + File.separator + accountId + File.separator + + volumeId; + + snapshotDestPath = ssPmountPath + File.separator + "snapshots" + + File.separator + dcId + File.separator + accountId + + File.separator + volumeId; + KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd + .getPrimaryStoragePoolNameLabel()); + KVMPhysicalDisk snapshotDisk = primaryPool.getPhysicalDisk(cmd + .getVolumePath()); + Script command = new Script(_manageSnapshotPath, _cmdsTimeout, + s_logger); + command.add("-b", snapshotDisk.getPath()); + command.add("-n", snapshotName); + command.add("-p", snapshotDestPath); + command.add("-t", snapshotName); + String result = command.execute(); + if (result != null) { + s_logger.debug("Failed to backup snaptshot: " + result); + return new BackupSnapshotAnswer(cmd, false, result, null, true); + } + /* Delete the snapshot on primary */ + + DomainInfo.DomainState state = null; + Domain vm = null; + if (vmName != null) { + try { + vm = getDomain(conn, cmd.getVmName()); + state = vm.getInfo().state; + } catch (LibvirtException e) { + + } + } + + KVMStoragePool primaryStorage = _storagePoolMgr.getStoragePool(cmd + .getPool().getUuid()); + if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING + && !primaryStorage.isExternalSnapshot()) { + String vmUuid = vm.getUUIDString(); + Object[] args = new Object[] { snapshotName, vmUuid }; + String snapshot = SnapshotXML.format(args); + s_logger.debug(snapshot); + DomainSnapshot snap = vm.snapshotLookupByName(snapshotName); + snap.delete(0); + + /* + * libvirt on RHEL6 doesn't handle resume event emitted from + * qemu + */ + vm = getDomain(conn, cmd.getVmName()); + state = vm.getInfo().state; + if (state == DomainInfo.DomainState.VIR_DOMAIN_PAUSED) { + vm.resume(); + } + } else { + command = new Script(_manageSnapshotPath, _cmdsTimeout, + s_logger); + command.add("-d", snapshotDisk.getPath()); + command.add("-n", snapshotName); + result = command.execute(); + if (result != null) { + s_logger.debug("Failed to backup snapshot: " + result); + return new BackupSnapshotAnswer(cmd, false, + "Failed to backup snapshot: " + result, null, true); + } + } + } catch (LibvirtException e) { + return new BackupSnapshotAnswer(cmd, false, e.toString(), null, + true); + } catch (CloudRuntimeException e) { + return new BackupSnapshotAnswer(cmd, false, e.toString(), null, + true); + } finally { + if (secondaryStoragePool != null) { + secondaryStoragePool.delete(); + } + } + return new BackupSnapshotAnswer(cmd, true, null, snapshotRelPath + + File.separator + snapshotName, true); + } + + protected DeleteSnapshotBackupAnswer execute( + final DeleteSnapshotBackupCommand cmd) { + Long dcId = cmd.getDataCenterId(); + Long accountId = cmd.getAccountId(); + Long volumeId = cmd.getVolumeId(); + KVMStoragePool secondaryStoragePool = null; + try { + secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI(cmd + .getSecondaryStorageUrl()); + + String ssPmountPath = secondaryStoragePool.getLocalPath(); + String snapshotDestPath = ssPmountPath + File.separator + + "snapshots" + File.separator + dcId + File.separator + + accountId + File.separator + volumeId; + + final Script command = new Script(_manageSnapshotPath, + _cmdsTimeout, s_logger); + command.add("-d", snapshotDestPath); + command.add("-n", cmd.getSnapshotName()); + + command.execute(); + } catch (CloudRuntimeException e) { + return new DeleteSnapshotBackupAnswer(cmd, false, e.toString()); + } finally { + if (secondaryStoragePool != null) { + secondaryStoragePool.delete(); + } + } + return new DeleteSnapshotBackupAnswer(cmd, true, null); + } + + protected Answer execute(DeleteSnapshotsDirCommand cmd) { + Long dcId = cmd.getDcId(); + Long accountId = cmd.getAccountId(); + Long volumeId = cmd.getVolumeId(); + KVMStoragePool secondaryStoragePool = null; + try { + secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI(cmd + .getSecondaryStorageUrl()); + + String ssPmountPath = secondaryStoragePool.getLocalPath(); + String snapshotDestPath = ssPmountPath + File.separator + + "snapshots" + File.separator + dcId + File.separator + + accountId + File.separator + volumeId; + + final Script command = new Script(_manageSnapshotPath, + _cmdsTimeout, s_logger); + command.add("-d", snapshotDestPath); + command.add("-f"); + command.execute(); + } catch (CloudRuntimeException e) { + return new Answer(cmd, false, e.toString()); + } finally { + if (secondaryStoragePool != null) { + secondaryStoragePool.delete(); + } + + } + return new Answer(cmd, true, null); + } + + protected CreateVolumeFromSnapshotAnswer execute( + final CreateVolumeFromSnapshotCommand cmd) { + try { + + String snapshotPath = cmd.getSnapshotUuid(); + int index = snapshotPath.lastIndexOf("/"); + snapshotPath = snapshotPath.substring(0, index); + KVMStoragePool secondaryPool = _storagePoolMgr + .getStoragePoolByURI(cmd.getSecondaryStorageUrl() + + snapshotPath); + KVMPhysicalDisk snapshot = secondaryPool.getPhysicalDisk(cmd + .getSnapshotName()); + + String primaryUuid = cmd.getPrimaryStoragePoolNameLabel(); + KVMStoragePool primaryPool = _storagePoolMgr + .getStoragePool(primaryUuid); + String volUuid = UUID.randomUUID().toString(); + KVMPhysicalDisk disk = _storagePoolMgr.copyPhysicalDisk(snapshot, + volUuid, primaryPool); + return new CreateVolumeFromSnapshotAnswer(cmd, true, "", + disk.getName()); + } catch (CloudRuntimeException e) { + return new CreateVolumeFromSnapshotAnswer(cmd, false, e.toString(), + null); + } + } + + protected Answer execute(final UpgradeSnapshotCommand cmd) { + + return new Answer(cmd, true, "success"); + } + + protected CreatePrivateTemplateAnswer execute( + final CreatePrivateTemplateFromSnapshotCommand cmd) { + String templateFolder = cmd.getAccountId() + File.separator + + cmd.getNewTemplateId(); + String templateInstallFolder = "template/tmpl/" + templateFolder; + String tmplName = UUID.randomUUID().toString(); + String tmplFileName = tmplName + ".qcow2"; + KVMStoragePool secondaryPool = null; + KVMStoragePool snapshotPool = null; + try { + String snapshotPath = cmd.getSnapshotUuid(); + int index = snapshotPath.lastIndexOf("/"); + snapshotPath = snapshotPath.substring(0, index); + snapshotPool = _storagePoolMgr.getStoragePoolByURI(cmd + .getSecondaryStorageUrl() + snapshotPath); + KVMPhysicalDisk snapshot = snapshotPool.getPhysicalDisk(cmd + .getSnapshotName()); + + secondaryPool = _storagePoolMgr.getStoragePoolByURI(cmd + .getSecondaryStorageUrl()); + + String templatePath = secondaryPool.getLocalPath() + File.separator + + templateInstallFolder; + + _storage.mkdirs(templatePath); + + String tmplPath = templateInstallFolder + File.separator + + tmplFileName; + Script command = new Script(_createTmplPath, _cmdsTimeout, s_logger); + command.add("-t", templatePath); + command.add("-n", tmplFileName); + command.add("-f", snapshot.getPath()); + command.execute(); + + Map params = new HashMap(); + params.put(StorageLayer.InstanceConfigKey, _storage); + Processor qcow2Processor = new QCOW2Processor(); + qcow2Processor.configure("QCOW2 Processor", params); + FormatInfo info = qcow2Processor.process(templatePath, null, + tmplName); + + TemplateLocation loc = new TemplateLocation(_storage, templatePath); + loc.create(1, true, tmplName); + loc.addFormat(info); + loc.save(); + + return new CreatePrivateTemplateAnswer(cmd, true, "", tmplPath, + info.virtualSize, info.size, tmplName, info.format); + } catch (ConfigurationException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); + } catch (InternalErrorException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); + } catch (IOException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); + } catch (CloudRuntimeException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); + } finally { + if (secondaryPool != null) { + secondaryPool.delete(); + } + if (snapshotPool != null) { + snapshotPool.delete(); + } + } + } + + protected GetStorageStatsAnswer execute(final GetStorageStatsCommand cmd) { + try { + KVMStoragePool sp = _storagePoolMgr.getStoragePool(cmd + .getStorageId()); + return new GetStorageStatsAnswer(cmd, sp.getCapacity(), + sp.getUsed()); + } catch (CloudRuntimeException e) { + return new GetStorageStatsAnswer(cmd, e.toString()); + } + } + + protected CreatePrivateTemplateAnswer execute( + CreatePrivateTemplateFromVolumeCommand cmd) { + String secondaryStorageURL = cmd.getSecondaryStorageUrl(); + + KVMStoragePool secondaryStorage = null; + try { + Connect conn = LibvirtConnection.getConnection(); + String templateFolder = cmd.getAccountId() + File.separator + + cmd.getTemplateId() + File.separator; + String templateInstallFolder = "/template/tmpl/" + templateFolder; + + secondaryStorage = _storagePoolMgr + .getStoragePoolByURI(secondaryStorageURL); + + KVMStoragePool primary = _storagePoolMgr.getStoragePool(cmd + .getPrimaryStoragePoolNameLabel()); + KVMPhysicalDisk disk = primary.getPhysicalDisk(cmd.getVolumePath()); + String tmpltPath = secondaryStorage.getLocalPath() + File.separator + + templateInstallFolder; + _storage.mkdirs(tmpltPath); + + Script command = new Script(_createTmplPath, _cmdsTimeout, s_logger); + command.add("-f", disk.getPath()); + command.add("-t", tmpltPath); + command.add("-n", cmd.getUniqueName() + ".qcow2"); + + String result = command.execute(); + + if (result != null) { + s_logger.debug("failed to create template: " + result); + return new CreatePrivateTemplateAnswer(cmd, false, result); + } + + Map params = new HashMap(); + params.put(StorageLayer.InstanceConfigKey, _storage); + Processor qcow2Processor = new QCOW2Processor(); + + qcow2Processor.configure("QCOW2 Processor", params); + + FormatInfo info = qcow2Processor.process(tmpltPath, null, + cmd.getUniqueName()); + + TemplateLocation loc = new TemplateLocation(_storage, tmpltPath); + loc.create(1, true, cmd.getUniqueName()); + loc.addFormat(info); + loc.save(); + + return new CreatePrivateTemplateAnswer(cmd, true, null, + templateInstallFolder + cmd.getUniqueName() + ".qcow2", + info.virtualSize, info.size, cmd.getUniqueName(), + ImageFormat.QCOW2); + } catch (LibvirtException e) { + s_logger.debug("Failed to get secondary storage pool: " + + e.toString()); + return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); + } catch (InternalErrorException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); + } catch (IOException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); + } catch (ConfigurationException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); + } catch (CloudRuntimeException e) { + return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); + } finally { + if (secondaryStorage != null) { + secondaryStorage.delete(); + } + } + } + + protected PrimaryStorageDownloadAnswer execute( + final PrimaryStorageDownloadCommand cmd) { + String tmplturl = cmd.getUrl(); + int index = tmplturl.lastIndexOf("/"); + String mountpoint = tmplturl.substring(0, index); + String tmpltname = null; + if (index < tmplturl.length() - 1) { + tmpltname = tmplturl.substring(index + 1); + } + + KVMPhysicalDisk tmplVol = null; + KVMStoragePool secondaryPool = null; + try { + secondaryPool = _storagePoolMgr.getStoragePoolByURI(mountpoint); + + /* Get template vol */ + if (tmpltname == null) { + secondaryPool.refresh(); + List disks = secondaryPool.listPhysicalDisks(); + if (disks == null || disks.isEmpty()) { + return new PrimaryStorageDownloadAnswer( + "Failed to get volumes from pool: " + + secondaryPool.getUuid()); + } + for (KVMPhysicalDisk disk : disks) { + if (disk.getName().endsWith("qcow2")) { + tmplVol = disk; + break; + } + } + if (tmplVol == null) { + return new PrimaryStorageDownloadAnswer( + "Failed to get template from pool: " + + secondaryPool.getUuid()); + } + } else { + tmplVol = secondaryPool.getPhysicalDisk(tmpltname); + } + + /* Copy volume to primary storage */ + KVMStoragePool primaryPool = _storagePoolMgr.getStoragePool(cmd + .getPoolUuid()); + + KVMPhysicalDisk primaryVol = _storagePoolMgr.copyPhysicalDisk( + tmplVol, UUID.randomUUID().toString(), primaryPool); + + return new PrimaryStorageDownloadAnswer(primaryVol.getName(), + primaryVol.getSize()); + } catch (CloudRuntimeException e) { + return new PrimaryStorageDownloadAnswer(e.toString()); + } finally { + if (secondaryPool != null) { + secondaryPool.delete(); + } + } + } + + protected Answer execute(CreateStoragePoolCommand cmd) { + return new Answer(cmd, true, "success"); + } + + protected Answer execute(ModifyStoragePoolCommand cmd) { + KVMStoragePool storagepool = _storagePoolMgr.createStoragePool(cmd + .getPool().getUuid(), cmd.getPool().getHost(), cmd.getPool() + .getPath(), cmd.getPool().getType()); + if (storagepool == null) { + return new Answer(cmd, false, " Failed to create storage pool"); + } + + Map tInfo = new HashMap(); + ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, + storagepool.getCapacity(), storagepool.getUsed(), tInfo); + + return answer; + } + + private Answer execute(SecurityGroupRulesCmd cmd) { + String vif = null; + String brname = null; + try { + Connect conn = LibvirtConnection.getConnection(); + List nics = getInterfaces(conn, cmd.getVmName()); + vif = nics.get(0).getDevName(); + brname = nics.get(0).getBrName(); + } catch (LibvirtException e) { + return new SecurityGroupRuleAnswer(cmd, false, e.toString()); + } + + boolean result = add_network_rules(cmd.getVmName(), + Long.toString(cmd.getVmId()), cmd.getGuestIp(), + cmd.getSignature(), Long.toString(cmd.getSeqNum()), + cmd.getGuestMac(), cmd.stringifyRules(), vif, brname); + + if (!result) { + s_logger.warn("Failed to program network rules for vm " + + cmd.getVmName()); + return new SecurityGroupRuleAnswer(cmd, false, + "programming network rules failed"); + } else { + s_logger.debug("Programmed network rules for vm " + cmd.getVmName() + + " guestIp=" + cmd.getGuestIp() + ",ingress numrules=" + + cmd.getIngressRuleSet().length + ",egress numrules=" + + cmd.getEgressRuleSet().length); + return new SecurityGroupRuleAnswer(cmd); + } + } + + private Answer execute(CleanupNetworkRulesCmd cmd) { + boolean result = cleanup_rules(); + return new Answer(cmd, result, ""); + } + + protected GetVncPortAnswer execute(GetVncPortCommand cmd) { + try { + Connect conn = LibvirtConnection.getConnection(); + Integer vncPort = getVncPort(conn, cmd.getName()); + return new GetVncPortAnswer(cmd, _privateIp, 5900 + vncPort); + } catch (Exception e) { + return new GetVncPortAnswer(cmd, e.toString()); + } + } + + protected Answer execute(final CheckConsoleProxyLoadCommand cmd) { + return executeProxyLoadScan(cmd, cmd.getProxyVmId(), + cmd.getProxyVmName(), cmd.getProxyManagementIp(), + cmd.getProxyCmdPort()); + } + + protected Answer execute(final WatchConsoleProxyLoadCommand cmd) { + return executeProxyLoadScan(cmd, cmd.getProxyVmId(), + cmd.getProxyVmName(), cmd.getProxyManagementIp(), + cmd.getProxyCmdPort()); + } + + protected MaintainAnswer execute(MaintainCommand cmd) { + return new MaintainAnswer(cmd); + } + + private Answer executeProxyLoadScan(final Command cmd, + final long proxyVmId, final String proxyVmName, + final String proxyManagementIp, final int cmdPort) { + String result = null; + + final StringBuffer sb = new StringBuffer(); + sb.append("http://").append(proxyManagementIp).append(":" + cmdPort) + .append("/cmd/getstatus"); + + boolean success = true; + try { + final URL url = new URL(sb.toString()); + final URLConnection conn = url.openConnection(); + + final InputStream is = conn.getInputStream(); + final BufferedReader reader = new BufferedReader( + new InputStreamReader(is)); + final StringBuilder sb2 = new StringBuilder(); + String line = null; + try { + while ((line = reader.readLine()) != null) { + sb2.append(line + "\n"); + } + result = sb2.toString(); + } catch (final IOException e) { + success = false; + } finally { + try { + is.close(); + } catch (final IOException e) { + s_logger.warn("Exception when closing , console proxy address : " + + proxyManagementIp); + success = false; + } + } + } catch (final IOException e) { + s_logger.warn("Unable to open console proxy command port url, console proxy address : " + + proxyManagementIp); + success = false; + } + + return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, + result); + } + + private Answer execute(AttachIsoCommand cmd) { + try { + Connect conn = LibvirtConnection.getConnection(); + attachOrDetachISO(conn, cmd.getVmName(), cmd.getIsoPath(), + cmd.isAttach()); + } catch (LibvirtException e) { + return new Answer(cmd, false, e.toString()); + } catch (URISyntaxException e) { + return new Answer(cmd, false, e.toString()); + } catch (InternalErrorException e) { + return new Answer(cmd, false, e.toString()); + } + + return new Answer(cmd); + } + + private AttachVolumeAnswer execute(AttachVolumeCommand cmd) { + try { + Connect conn = LibvirtConnection.getConnection(); + KVMStoragePool primary = _storagePoolMgr.getStoragePool(cmd + .getPoolUuid()); + KVMPhysicalDisk disk = primary.getPhysicalDisk(cmd.getVolumePath()); + attachOrDetachDisk(conn, cmd.getAttach(), cmd.getVmName(), disk, + cmd.getDeviceId().intValue()); + } catch (LibvirtException e) { + return new AttachVolumeAnswer(cmd, e.toString()); + } catch (InternalErrorException e) { + return new AttachVolumeAnswer(cmd, e.toString()); + } + + return new AttachVolumeAnswer(cmd, cmd.getDeviceId()); + } + + private Answer execute(ReadyCommand cmd) { + return new ReadyAnswer(cmd); + } + + protected State convertToState(DomainInfo.DomainState ps) { + final State state = s_statesTable.get(ps); + return state == null ? State.Unknown : state; + } + + protected State getVmState(Connect conn, final String vmName) { + int retry = 3; + Domain vms = null; + while (retry-- > 0) { + try { + vms = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + State s = convertToState(vms.getInfo().state); + return s; + } catch (final LibvirtException e) { + s_logger.warn("Can't get vm state " + vmName + e.getMessage() + + "retry:" + retry); + } catch (Exception e) { + s_logger.warn("Can't get vm state " + vmName + e.getMessage() + + "retry:" + retry); + } finally { + try { + if (vms != null) { + vms.free(); + } + } catch (final LibvirtException e) { + + } + } + } + return State.Stopped; + } + + private Answer execute(CheckVirtualMachineCommand cmd) { + try { + Connect conn = LibvirtConnection.getConnection(); + final State state = getVmState(conn, cmd.getVmName()); + Integer vncPort = null; + if (state == State.Running) { + vncPort = getVncPort(conn, cmd.getVmName()); + + synchronized (_vms) { + _vms.put(cmd.getVmName(), State.Running); + } + } + + return new CheckVirtualMachineAnswer(cmd, state, vncPort); + } catch (LibvirtException e) { + return new CheckVirtualMachineAnswer(cmd, e.getMessage()); + } + } + + private Answer execute(PingTestCommand cmd) { + String result = null; + final String computingHostIp = cmd.getComputingHostIp(); // TODO, split + // the + // command + // into 2 + // types + + if (computingHostIp != null) { + result = doPingTest(computingHostIp); + } else if (cmd.getRouterIp() != null && cmd.getPrivateIp() != null) { + result = doPingTest(cmd.getRouterIp(), cmd.getPrivateIp()); + } else { + return new Answer(cmd, false, "routerip and private ip is null"); + } + + if (result != null) { + return new Answer(cmd, false, result); + } + return new Answer(cmd); + } + + private String doPingTest(final String computingHostIp) { + final Script command = new Script(_pingTestPath, 10000, s_logger); + command.add("-h", computingHostIp); + return command.execute(); + } + + private String doPingTest(final String domRIp, final String vmIp) { + final Script command = new Script(_pingTestPath, 10000, s_logger); + command.add("-i", domRIp); + command.add("-p", vmIp); + return command.execute(); + } + + private synchronized Answer execute(MigrateCommand cmd) { + String vmName = cmd.getVmName(); + + State state = null; + String result = null; + synchronized (_vms) { + state = _vms.get(vmName); + _vms.put(vmName, State.Stopping); + } + + Domain dm = null; + Connect dconn = null; + Domain destDomain = null; + Connect conn = null; + try { + conn = LibvirtConnection.getConnection(); + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + dconn = new Connect("qemu+tcp://" + cmd.getDestinationIp() + + "/system"); + /* + * Hard code lm flags: VIR_MIGRATE_LIVE(1<<0) and + * VIR_MIGRATE_PERSIST_DEST(1<<3) + */ + destDomain = dm.migrate(dconn, (1 << 0) | (1 << 3), vmName, "tcp:" + + cmd.getDestinationIp(), _migrateSpeed); + } catch (LibvirtException e) { + s_logger.debug("Can't migrate domain: " + e.getMessage()); + result = e.getMessage(); + } catch (Exception e) { + s_logger.debug("Can't migrate domain: " + e.getMessage()); + result = e.getMessage(); + } finally { + try { + if (dm != null) { + dm.free(); + } + if (dconn != null) { + dconn.close(); + } + if (destDomain != null) { + destDomain.free(); + } + } catch (final LibvirtException e) { + + } + } + + if (result != null) { + synchronized (_vms) { + _vms.put(vmName, state); + } + } else { + destroy_network_rules_for_vm(conn, vmName); + cleanupVM(conn, vmName, + getVnetId(VirtualMachineName.getVnet(vmName))); + } + + return new MigrateAnswer(cmd, result == null, result, null); + } + + private synchronized Answer execute(PrepareForMigrationCommand cmd) { + + VirtualMachineTO vm = cmd.getVirtualMachine(); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Preparing host for migrating " + vm); + } + + NicTO[] nics = vm.getNics(); + try { + Connect conn = LibvirtConnection.getConnection(); + for (NicTO nic : nics) { + String vlanId = null; + if (nic.getBroadcastType() == BroadcastDomainType.Vlan) { + URI broadcastUri = nic.getBroadcastUri(); + vlanId = broadcastUri.getHost(); + } + if (nic.getType() == TrafficType.Guest) { + if (nic.getBroadcastType() == BroadcastDomainType.Vlan + && !vlanId.equalsIgnoreCase("untagged")) { + createVlanBr(vlanId, _pifs.first()); + } + } else if (nic.getType() == TrafficType.Control) { + /* Make sure the network is still there */ + createControlNetwork(conn); + } else if (nic.getType() == TrafficType.Public) { + if (nic.getBroadcastType() == BroadcastDomainType.Vlan + && !vlanId.equalsIgnoreCase("untagged")) { + createVlanBr(vlanId, _pifs.second()); + } + } + } + + /* setup disks, e.g for iso */ + VolumeTO[] volumes = vm.getDisks(); + for (VolumeTO volume : volumes) { + if (volume.getType() == Volume.Type.ISO) { + getVolumePath(conn, volume); + } + } + + synchronized (_vms) { + _vms.put(vm.getName(), State.Migrating); + } + + return new PrepareForMigrationAnswer(cmd); + } catch (LibvirtException e) { + return new PrepareForMigrationAnswer(cmd, e.toString()); + } catch (InternalErrorException e) { + return new PrepareForMigrationAnswer(cmd, e.toString()); + } catch (URISyntaxException e) { + return new PrepareForMigrationAnswer(cmd, e.toString()); + } + } + + public void createVnet(String vnetId, String pif) + throws InternalErrorException { + final Script command = new Script(_modifyVlanPath, _timeout, s_logger); + command.add("-v", vnetId); + command.add("-p", pif); + command.add("-o", "add"); + + final String result = command.execute(); + if (result != null) { + throw new InternalErrorException("Failed to create vnet " + vnetId + + ": " + result); + } + } + + private Answer execute(CheckHealthCommand cmd) { + return new CheckHealthAnswer(cmd, true); + } + + private Answer execute(GetHostStatsCommand cmd) { + final Script cpuScript = new Script("/bin/bash", s_logger); + cpuScript.add("-c"); + cpuScript + .add("idle=$(top -b -n 1|grep Cpu\\(s\\):|cut -d% -f4|cut -d, -f2);echo $idle"); + + final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); + String result = cpuScript.execute(parser); + if (result != null) { + s_logger.debug("Unable to get the host CPU state: " + result); + return new Answer(cmd, false, result); + } + double cpuUtil = (100.0D - Double.parseDouble(parser.getLine())); + + long freeMem = 0; + final Script memScript = new Script("/bin/bash", s_logger); + memScript.add("-c"); + memScript + .add("freeMem=$(free|grep cache:|awk '{print $4}');echo $freeMem"); + final OutputInterpreter.OneLineParser Memparser = new OutputInterpreter.OneLineParser(); + result = memScript.execute(Memparser); + if (result != null) { + s_logger.debug("Unable to get the host Mem state: " + result); + return new Answer(cmd, false, result); + } + freeMem = Long.parseLong(Memparser.getLine()); + + Script totalMem = new Script("/bin/bash", s_logger); + totalMem.add("-c"); + totalMem.add("free|grep Mem:|awk '{print $2}'"); + final OutputInterpreter.OneLineParser totMemparser = new OutputInterpreter.OneLineParser(); + result = totalMem.execute(totMemparser); + if (result != null) { + s_logger.debug("Unable to get the host Mem state: " + result); + return new Answer(cmd, false, result); + } + long totMem = Long.parseLong(totMemparser.getLine()); + + Pair nicStats = getNicStats(_publicBridgeName); + + HostStatsEntry hostStats = new HostStatsEntry(cmd.getHostId(), cpuUtil, + nicStats.first() / 1000, nicStats.second() / 1000, "host", + totMem, freeMem, 0, 0); + return new GetHostStatsAnswer(cmd, hostStats); + } + + protected String networkUsage(final String privateIpAddress, + final String option, final String vif) { + Script getUsage = new Script(_networkUsagePath, s_logger); + if (option.equals("get")) { + getUsage.add("-g"); + } else if (option.equals("create")) { + getUsage.add("-c"); + } else if (option.equals("reset")) { + getUsage.add("-r"); + } else if (option.equals("addVif")) { + getUsage.add("-a", vif); + } else if (option.equals("deleteVif")) { + getUsage.add("-d", vif); + } + + getUsage.add("-i", privateIpAddress); + final OutputInterpreter.OneLineParser usageParser = new OutputInterpreter.OneLineParser(); + String result = getUsage.execute(usageParser); + if (result != null) { + s_logger.debug("Failed to execute networkUsage:" + result); + return null; + } + return usageParser.getLine(); + } + + protected long[] getNetworkStats(String privateIP) { + String result = networkUsage(privateIP, "get", null); + long[] stats = new long[2]; + if (result != null) { + String[] splitResult = result.split(":"); + int i = 0; + while (i < splitResult.length - 1) { + stats[0] += (new Long(splitResult[i++])).longValue(); + stats[1] += (new Long(splitResult[i++])).longValue(); + } + } + return stats; + } + + private Answer execute(NetworkUsageCommand cmd) { + if (cmd.getOption() != null && cmd.getOption().equals("create")) { + String result = networkUsage(cmd.getPrivateIP(), "create", null); + NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, result, 0L, + 0L); + return answer; + } + long[] stats = getNetworkStats(cmd.getPrivateIP()); + NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, "", stats[0], + stats[1]); + return answer; + } + + private Answer execute(RebootCommand cmd) { + Long bytesReceived = null; + Long bytesSent = null; + + synchronized (_vms) { + _vms.put(cmd.getVmName(), State.Starting); + } + + try { + Connect conn = LibvirtConnection.getConnection(); + final String result = rebootVM(conn, cmd.getVmName()); + if (result == null) { + Integer vncPort = null; + try { + vncPort = getVncPort(conn, cmd.getVmName()); + } catch (Exception e) { + + } + get_rule_logs_for_vms(); + return new RebootAnswer(cmd, null, bytesSent, bytesReceived, + vncPort); + } else { + return new RebootAnswer(cmd, result); + } + } catch (LibvirtException e) { + return new RebootAnswer(cmd, e.getMessage()); + } finally { + synchronized (_vms) { + _vms.put(cmd.getVmName(), State.Running); + } + } + } + + protected Answer execute(RebootRouterCommand cmd) { + Long bytesSent = 0L; + Long bytesRcvd = 0L; + if (VirtualMachineName.isValidRouterName(cmd.getVmName())) { + long[] stats = getNetworkStats(cmd.getPrivateIpAddress()); + bytesSent = stats[0]; + bytesRcvd = stats[1]; + } + RebootAnswer answer = (RebootAnswer) execute((RebootCommand) cmd); + answer.setBytesSent(bytesSent); + answer.setBytesReceived(bytesRcvd); + String result = _virtRouterResource.connect(cmd.getPrivateIpAddress()); + if (result == null) { + networkUsage(cmd.getPrivateIpAddress(), "create", null); + return answer; + } else { + return new Answer(cmd, false, result); + } + } + + protected GetVmStatsAnswer execute(GetVmStatsCommand cmd) { + List vmNames = cmd.getVmNames(); + try { + HashMap vmStatsNameMap = new HashMap(); + Connect conn = LibvirtConnection.getConnection(); + for (String vmName : vmNames) { + VmStatsEntry statEntry = getVmStat(conn, vmName); + if (statEntry == null) { + continue; + } + + vmStatsNameMap.put(vmName, statEntry); + } + return new GetVmStatsAnswer(cmd, vmStatsNameMap); + } catch (LibvirtException e) { + s_logger.debug("Can't get vm stats: " + e.toString()); + return new GetVmStatsAnswer(cmd, null); + } + } + + protected Answer execute(StopCommand cmd) { + final String vmName = cmd.getVmName(); + + Long bytesReceived = new Long(0); + Long bytesSent = new Long(0); + + State state = null; + synchronized (_vms) { + state = _vms.get(vmName); + _vms.put(vmName, State.Stopping); + } + try { + Connect conn = LibvirtConnection.getConnection(); + + List disks = getDisks(conn, vmName); + destroy_network_rules_for_vm(conn, vmName); + String result = stopVM(conn, vmName, defineOps.UNDEFINE_VM); + if (result == null) { + for (DiskDef disk : disks) { + if (disk.getDeviceType() == DiskDef.deviceType.CDROM + && disk.getDiskPath() != null) + cleanupDisk(conn, disk); + } + } + + final String result2 = cleanupVnet(conn, cmd.getVnet()); + + if (result != null && result2 != null) { + result = result2 + result; + } + state = State.Stopped; + return new StopAnswer(cmd, result, 0, bytesSent, bytesReceived); + } catch (LibvirtException e) { + return new StopAnswer(cmd, e.getMessage()); + } finally { + synchronized (_vms) { + if (state != null) { + _vms.put(vmName, state); + } else { + _vms.remove(vmName); + } + } + } + } + + protected Answer execute(ModifySshKeysCommand cmd) { + File sshKeysDir = new File(_SSHKEYSPATH); + String result = null; + if (!sshKeysDir.exists()) { + sshKeysDir.mkdir(); + // Change permissions for the 600 + Script script = new Script("chmod", _timeout, s_logger); + script.add("600", _SSHKEYSPATH); + script.execute(); + } + + File pubKeyFile = new File(_SSHPUBKEYPATH); + if (!pubKeyFile.exists()) { + try { + pubKeyFile.createNewFile(); + } catch (IOException e) { + result = "Failed to create file: " + e.toString(); + s_logger.debug(result); + } + } + + if (pubKeyFile.exists()) { + String pubKey = cmd.getPubKey(); + try { + FileOutputStream pubkStream = new FileOutputStream(pubKeyFile); + pubkStream.write(pubKey.getBytes()); + pubkStream.close(); + } catch (FileNotFoundException e) { + result = "File" + _SSHPUBKEYPATH + "is not found:" + + e.toString(); + s_logger.debug(result); + } catch (IOException e) { + result = "Write file " + _SSHPUBKEYPATH + ":" + e.toString(); + s_logger.debug(result); + } + } + + File prvKeyFile = new File(_SSHPRVKEYPATH); + if (!prvKeyFile.exists()) { + try { + prvKeyFile.createNewFile(); + } catch (IOException e) { + result = "Failed to create file: " + e.toString(); + s_logger.debug(result); + } + } + + if (prvKeyFile.exists()) { + String prvKey = cmd.getPrvKey(); + try { + FileOutputStream prvKStream = new FileOutputStream(prvKeyFile); + prvKStream.write(prvKey.getBytes()); + prvKStream.close(); + } catch (FileNotFoundException e) { + result = "File" + _SSHPRVKEYPATH + "is not found:" + + e.toString(); + s_logger.debug(result); + } catch (IOException e) { + result = "Write file " + _SSHPRVKEYPATH + ":" + e.toString(); + s_logger.debug(result); + } + + Script script = new Script("chmod", _timeout, s_logger); + script.add("600", _SSHPRVKEYPATH); + script.execute(); + } + + if (result != null) { + return new Answer(cmd, false, result); + } else { + return new Answer(cmd, true, null); + } + } + + protected void handleVmStartFailure(Connect conn, String vmName, + LibvirtVMDef vm) { + if (vm != null && vm.getDevices() != null) { + cleanupVMNetworks(conn, vm.getDevices().getInterfaces()); + } + } + + protected LibvirtVMDef createVMFromSpec(VirtualMachineTO vmTO) { + LibvirtVMDef vm = new LibvirtVMDef(); + vm.setHvsType(_hypervisorType); + vm.setDomainName(vmTO.getName()); + vm.setDomUUID(UUID.nameUUIDFromBytes(vmTO.getName().getBytes()) + .toString()); + vm.setDomDescription(vmTO.getOs()); + + GuestDef guest = new GuestDef(); + guest.setGuestType(GuestDef.guestType.KVM); + guest.setGuestArch(vmTO.getArch()); + guest.setMachineType("pc"); + guest.setBootOrder(GuestDef.bootOrder.CDROM); + guest.setBootOrder(GuestDef.bootOrder.HARDISK); + + vm.addComp(guest); + + GuestResourceDef grd = new GuestResourceDef(); + grd.setMemorySize(vmTO.getMinRam() / 1024); + grd.setVcpuNum(vmTO.getCpus()); + vm.addComp(grd); + + FeaturesDef features = new FeaturesDef(); + features.addFeatures("pae"); + features.addFeatures("apic"); + features.addFeatures("acpi"); + vm.addComp(features); + + TermPolicy term = new TermPolicy(); + term.setCrashPolicy("destroy"); + term.setPowerOffPolicy("destroy"); + term.setRebootPolicy("restart"); + vm.addComp(term); + + ClockDef clock = new ClockDef(); + if (vmTO.getOs().startsWith("Windows")) { + clock.setClockOffset(ClockDef.ClockOffset.LOCALTIME); + clock.setTimer("rtc", "catchup", null); + } + + vm.addComp(clock); + + DevicesDef devices = new DevicesDef(); + devices.setEmulatorPath(_hypervisorPath); + + SerialDef serial = new SerialDef("pty", null, (short) 0); + devices.addDevice(serial); + + ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0); + devices.addDevice(console); + + GraphicDef grap = new GraphicDef("vnc", (short) 0, true, vmTO.getVncAddr(), null, + null); + devices.addDevice(grap); + + InputDef input = new InputDef("tablet", "usb"); + devices.addDevice(input); + + vm.addComp(devices); + + return vm; + } + + protected void createVifs(Connect conn, VirtualMachineTO vmSpec, + LibvirtVMDef vm) throws InternalErrorException, LibvirtException { + NicTO[] nics = vmSpec.getNics(); + for (int i = 0; i < nics.length; i++) { + for (NicTO nic : vmSpec.getNics()) { + if (nic.getDeviceId() == i) { + createVif(conn, vm, nic); + } + } + } + } + + protected synchronized StartAnswer execute(StartCommand cmd) { + VirtualMachineTO vmSpec = cmd.getVirtualMachine(); + vmSpec.setVncAddr(cmd.getHostIp()); + String vmName = vmSpec.getName(); + LibvirtVMDef vm = null; + + State state = State.Stopped; + Connect conn = null; + try { + conn = LibvirtConnection.getConnection(); + synchronized (_vms) { + _vms.put(vmName, State.Starting); + } + + vm = createVMFromSpec(vmSpec); + + createVbd(conn, vmSpec, vmName, vm); + + createVifs(conn, vmSpec, vm); + + s_logger.debug("starting " + vmName + ": " + vm.toString()); + startDomain(conn, vmName, vm.toString()); + Script.runSimpleBashScript("virsh schedinfo " + vmName + + " --set cpu_shares=" + vmSpec.getCpus() + * vmSpec.getSpeed()); + + NicTO[] nics = vmSpec.getNics(); + for (NicTO nic : nics) { + if (nic.getIsolationUri() != null + && nic.getIsolationUri().getScheme() + .equalsIgnoreCase(IsolationType.Ec2.toString())) { + if (vmSpec.getType() != VirtualMachine.Type.User) { + default_network_rules_for_systemvm(conn, vmName); + break; + } else { + default_network_rules(conn, vmName, nic, vmSpec.getId()); + } + } + } + + state = State.Running; + return new StartAnswer(cmd); + } catch (Exception e) { + s_logger.warn("Exception ", e); + if (conn != null) { + handleVmStartFailure(conn, vmName, vm); + } + return new StartAnswer(cmd, e.getMessage()); + } finally { + synchronized (_vms) { + if (state != State.Stopped) { + _vms.put(vmName, state); + } else { + _vms.remove(vmName); + } + } + } + } + + private String getVolumePath(Connect conn, VolumeTO volume) + throws LibvirtException, URISyntaxException { + if (volume.getType() == Volume.Type.ISO && volume.getPath() != null) { + String isoPath = volume.getPath(); + int index = isoPath.lastIndexOf("/"); + String path = isoPath.substring(0, index); + String name = isoPath.substring(index + 1); + KVMStoragePool secondaryPool = _storagePoolMgr + .getStoragePoolByURI(path); + KVMPhysicalDisk isoVol = secondaryPool.getPhysicalDisk(name); + return isoVol.getPath(); + } else { + return volume.getPath(); + } + } + + protected void createVbd(Connect conn, VirtualMachineTO vmSpec, + String vmName, LibvirtVMDef vm) throws InternalErrorException, + LibvirtException, URISyntaxException { + List disks = Arrays.asList(vmSpec.getDisks()); + Collections.sort(disks, new Comparator() { + @Override + public int compare(VolumeTO arg0, VolumeTO arg1) { + return arg0.getDeviceId() > arg1.getDeviceId() ? 1 : -1; + } + }); + + for (VolumeTO volume : disks) { + KVMPhysicalDisk physicalDisk = null; + KVMStoragePool pool = null; + if (volume.getType() == Volume.Type.ISO && volume.getPath() != null) { + String volPath = volume.getPath(); + int index = volPath.lastIndexOf("/"); + String volDir = volPath.substring(0, index); + String volName = volPath.substring(index + 1); + KVMStoragePool secondaryStorage = _storagePoolMgr + .getStoragePoolByURI(volDir); + physicalDisk = secondaryStorage.getPhysicalDisk(volName); + } else if (volume.getType() != Volume.Type.ISO) { + pool = _storagePoolMgr.getStoragePool(volume.getPoolUuid()); + physicalDisk = pool.getPhysicalDisk(volume.getPath()); + } + + String volPath = null; + if (physicalDisk != null) { + volPath = physicalDisk.getPath(); + } + + DiskDef.diskBus diskBusType = getGuestDiskModel(vmSpec.getOs()); + DiskDef disk = new DiskDef(); + if (volume.getType() == Volume.Type.ISO) { + if (volPath == null) { + /* Add iso as placeholder */ + disk.defISODisk(null); + } else { + disk.defISODisk(volPath); + } + } else { + int devId = (int) volume.getDeviceId(); + + if (volume.getType() == Volume.Type.DATADISK) { + disk.defFileBasedDisk(physicalDisk.getPath(), devId, + DiskDef.diskBus.VIRTIO, + DiskDef.diskFmtType.QCOW2); + } else { + disk.defFileBasedDisk(physicalDisk.getPath(), devId, + diskBusType, DiskDef.diskFmtType.QCOW2); + } + + } + + vm.getDevices().addDevice(disk); + } + + if (vmSpec.getType() != VirtualMachine.Type.User) { + if (_sysvmISOPath != null) { + DiskDef iso = new DiskDef(); + iso.defISODisk(_sysvmISOPath); + vm.getDevices().addDevice(iso); + } + + createPatchVbd(conn, vmName, vm, vmSpec); + } + } + + private VolumeTO getVolume(VirtualMachineTO vmSpec, Volume.Type type) { + VolumeTO volumes[] = vmSpec.getDisks(); + for (VolumeTO volume : volumes) { + if (volume.getType() == type) { + return volume; + } + } + return null; + } + + private void createPatchVbd(Connect conn, String vmName, LibvirtVMDef vm, + VirtualMachineTO vmSpec) throws LibvirtException, + InternalErrorException { + + List disks = vm.getDevices().getDisks(); + DiskDef rootDisk = disks.get(0); + VolumeTO rootVol = getVolume(vmSpec, Volume.Type.ROOT); + KVMStoragePool pool = _storagePoolMgr.getStoragePool(rootVol + .getPoolUuid()); + KVMPhysicalDisk disk = pool.createPhysicalDisk(UUID.randomUUID() + .toString(), KVMPhysicalDisk.PhysicalDiskFormat.RAW, + 10L * 1024 * 1024); + /* Format/create fs on this disk */ + final Script command = new Script(_createvmPath, _timeout, s_logger); + command.add("-f", disk.getPath()); + String result = command.execute(); + if (result != null) { + s_logger.debug("Failed to create data disk: " + result); + throw new InternalErrorException("Failed to create data disk: " + + result); + } + String datadiskPath = disk.getPath(); + + /* add patch disk */ + DiskDef patchDisk = new DiskDef(); + + patchDisk.defFileBasedDisk(datadiskPath, 1, rootDisk.getBusType(), + DiskDef.diskFmtType.RAW); + + disks.add(patchDisk); + + String bootArgs = vmSpec.getBootArgs(); + + patchSystemVm(bootArgs, datadiskPath, vmName); + } + + private String createVlanBr(String vlanId, String nic) + throws InternalErrorException { + String brName = setVnetBrName(vlanId); + createVnet(vlanId, nic); + return brName; + } + + private InterfaceDef createVif(Connect conn, NicTO nic, + InterfaceDef.nicModel model) throws InternalErrorException, + LibvirtException { + InterfaceDef intf = new InterfaceDef(); + + String vlanId = null; + if (nic.getBroadcastType() == BroadcastDomainType.Vlan) { + URI broadcastUri = nic.getBroadcastUri(); + vlanId = broadcastUri.getHost(); + } + + if (nic.getType() == TrafficType.Guest) { + if (nic.getBroadcastType() == BroadcastDomainType.Vlan + && !vlanId.equalsIgnoreCase("untagged")) { + String brName = createVlanBr(vlanId, _pifs.first()); + intf.defBridgeNet(brName, null, nic.getMac(), model); + } else { + intf.defBridgeNet(_guestBridgeName, null, nic.getMac(), model); + } + } else if (nic.getType() == TrafficType.Control) { + /* Make sure the network is still there */ + createControlNetwork(conn); + intf.defBridgeNet(_linkLocalBridgeName, null, nic.getMac(), model); + } else if (nic.getType() == TrafficType.Public) { + if (nic.getBroadcastType() == BroadcastDomainType.Vlan + && !vlanId.equalsIgnoreCase("untagged")) { + String brName = createVlanBr(vlanId, _pifs.second()); + intf.defBridgeNet(brName, null, nic.getMac(), model); + } else { + intf.defBridgeNet(_publicBridgeName, null, nic.getMac(), model); + } + } else if (nic.getType() == TrafficType.Management) { + intf.defBridgeNet(_privBridgeName, null, nic.getMac(), model); + } else if (nic.getType() == TrafficType.Storage) { + String storageBrName = nic.getName() == null ? _privBridgeName + : nic.getName(); + intf.defBridgeNet(storageBrName, null, nic.getMac(), model); + } + + return intf; + } + + private void createVif(Connect conn, LibvirtVMDef vm, NicTO nic) + throws InternalErrorException, LibvirtException { + vm.getDevices().addDevice( + createVif(conn, nic, getGuestNicModel(vm.getGuestOSType()))); + } + + protected CheckSshAnswer execute(CheckSshCommand cmd) { + String vmName = cmd.getName(); + String privateIp = cmd.getIp(); + int cmdPort = cmd.getPort(); + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Ping command port, " + privateIp + ":" + cmdPort); + } + + try { + String result = _virtRouterResource.connect(privateIp, cmdPort); + if (result != null) { + return new CheckSshAnswer(cmd, "Can not ping System vm " + + vmName + "due to:" + result); + } + } catch (Exception e) { + return new CheckSshAnswer(cmd, e); + } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Ping command port succeeded for vm " + vmName); + } + + return new CheckSshAnswer(cmd); + } + + private boolean cleanupDisk(Connect conn, DiskDef disk) { + // need to umount secondary storage + String path = disk.getDiskPath(); + String poolUuid = null; + if (path != null) { + String[] token = path.split("/"); + if (token.length > 3) { + poolUuid = token[2]; + } + } + + if (poolUuid == null) { + return true; + } + + try { + KVMStoragePool pool = _storagePoolMgr.getStoragePool(poolUuid); + if (pool != null) { + pool.delete(); + } + return true; + } catch (CloudRuntimeException e) { + return false; + } + } + + protected synchronized String attachOrDetachISO(Connect conn, + String vmName, String isoPath, boolean isAttach) + throws LibvirtException, URISyntaxException, InternalErrorException { + String isoXml = null; + if (isoPath != null && isAttach) { + int index = isoPath.lastIndexOf("/"); + String path = isoPath.substring(0, index); + String name = isoPath.substring(index + 1); + KVMStoragePool secondaryPool = _storagePoolMgr + .getStoragePoolByURI(path); + KVMPhysicalDisk isoVol = secondaryPool.getPhysicalDisk(name); + isoPath = isoVol.getPath(); + + DiskDef iso = new DiskDef(); + iso.defISODisk(isoPath); + isoXml = iso.toString(); + } else { + DiskDef iso = new DiskDef(); + iso.defISODisk(null); + isoXml = iso.toString(); + } + + List disks = getDisks(conn, vmName); + String result = attachOrDetachDevice(conn, true, vmName, isoXml); + if (result == null && !isAttach) { + for (DiskDef disk : disks) { + if (disk.getDeviceType() == DiskDef.deviceType.CDROM) { + cleanupDisk(conn, disk); + } + } + + } + return result; + } + + protected synchronized String attachOrDetachDisk(Connect conn, + boolean attach, String vmName, KVMPhysicalDisk attachingDisk, + int devId) throws LibvirtException, InternalErrorException { + List disks = null; + Domain dm = null; + DiskDef diskdef = null; + try { + if (!attach) { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + String xml = dm.getXMLDesc(0); + parser.parseDomainXML(xml); + disks = parser.getDisks(); + + for (DiskDef disk : disks) { + String file = disk.getDiskPath(); + if (file != null + && file.equalsIgnoreCase(attachingDisk.getPath())) { + diskdef = disk; + break; + } + } + if (diskdef == null) { + throw new InternalErrorException("disk: " + + attachingDisk.getPath() + + " is not attached before"); + } + } else { + diskdef = new DiskDef(); + if (attachingDisk.getFormat() == PhysicalDiskFormat.QCOW2) { + diskdef.defFileBasedDisk(attachingDisk.getPath(), devId, + DiskDef.diskBus.VIRTIO, DiskDef.diskFmtType.QCOW2); + } else if (attachingDisk.getFormat() == PhysicalDiskFormat.RAW) { + diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId, + DiskDef.diskBus.VIRTIO); + } + } + + String xml = diskdef.toString(); + return attachOrDetachDevice(conn, attach, vmName, xml); + } finally { + if (dm != null) { + dm.free(); + } + } + } + + protected synchronized String attachOrDetachDevice(Connect conn, + boolean attach, String vmName, String xml) throws LibvirtException, + InternalErrorException { + Domain dm = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes((vmName + .getBytes()))); + + if (attach) { + s_logger.debug("Attaching device: " + xml); + dm.attachDevice(xml); + } else { + s_logger.debug("Detaching device: " + xml); + dm.detachDevice(xml); + } + } catch (LibvirtException e) { + if (attach) { + s_logger.warn("Failed to attach device to " + vmName + ": " + + e.getMessage()); + } else { + s_logger.warn("Failed to detach device from " + vmName + ": " + + e.getMessage()); + } + throw e; + } catch (Exception e) { + throw new InternalErrorException(e.toString()); + } finally { + if (dm != null) { + try { + dm.free(); + } catch (LibvirtException l) { + + } + } + } + + return null; + } + + @Override + public PingCommand getCurrentStatus(long id) { + final HashMap newStates = sync(); + + if (!_can_bridge_firewall) { + return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id, + newStates); + } else { + HashMap> nwGrpStates = syncNetworkGroups(id); + return new PingRoutingWithNwGroupsCommand(getType(), id, newStates, + nwGrpStates); + } + } + + @Override + public Type getType() { + return Type.Routing; + } + + private Map getVersionStrings() { + final Script command = new Script(_versionstringpath, _timeout, + s_logger); + KeyValueInterpreter kvi = new KeyValueInterpreter(); + String result = command.execute(kvi); + if (result == null) { + return kvi.getKeyValues(); + } else { + return new HashMap(1); + } + } + + @Override + public StartupCommand[] initialize() { + Map changes = null; + + synchronized (_vms) { + _vms.clear(); + changes = sync(); + } + + final List info = getHostInfo(); + + final StartupRoutingCommand cmd = new StartupRoutingCommand( + (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), + (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, + RouterPrivateIpStrategy.HostLocal); + cmd.setStateChanges(changes); + fillNetworkInformation(cmd); + _privateIp = cmd.getPrivateIpAddress(); + cmd.getHostDetails().putAll(getVersionStrings()); + cmd.setPool(_pool); + cmd.setCluster(_clusterId); + cmd.setGatewayIpAddress(_localGateway); + + StartupStorageCommand sscmd = null; + try { + + KVMStoragePool localStoragePool = _storagePoolMgr + .createStoragePool(_localStorageUUID, "localhost", + _localStoragePath, StoragePoolType.Filesystem); + com.cloud.agent.api.StoragePoolInfo pi = new com.cloud.agent.api.StoragePoolInfo( + localStoragePool.getUuid(), cmd.getPrivateIpAddress(), + _localStoragePath, _localStoragePath, + StoragePoolType.Filesystem, localStoragePool.getCapacity(), + localStoragePool.getUsed()); + + sscmd = new StartupStorageCommand(); + sscmd.setPoolInfo(pi); + sscmd.setGuid(pi.getUuid()); + sscmd.setDataCenter(_dcId); + sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); + } catch (CloudRuntimeException e) { + + } + + if (sscmd != null) { + return new StartupCommand[] { cmd, sscmd }; + } else { + return new StartupCommand[] { cmd }; + } + } + + protected HashMap sync() { + HashMap newStates; + HashMap oldStates = null; + + final HashMap changes = new HashMap(); + + synchronized (_vms) { + newStates = getAllVms(); + if (newStates == null) { + s_logger.debug("Unable to get the vm states so no state sync at this point."); + return changes; + } + + oldStates = new HashMap(_vms.size()); + oldStates.putAll(_vms); + + for (final Map.Entry entry : newStates.entrySet()) { + final String vm = entry.getKey(); + + State newState = entry.getValue(); + final State oldState = oldStates.remove(vm); + + if (newState == State.Stopped && oldState != State.Stopping + && oldState != null && oldState != State.Stopped) { + newState = getRealPowerState(vm); + } + + if (s_logger.isTraceEnabled()) { + s_logger.trace("VM " + vm + ": libvirt has state " + + newState + " and we have state " + + (oldState != null ? oldState.toString() : "null")); + } + + if (vm.startsWith("migrating")) { + s_logger.debug("Migration detected. Skipping"); + continue; + } + if (oldState == null) { + _vms.put(vm, newState); + s_logger.debug("Detecting a new state but couldn't find a old state so adding it to the changes: " + + vm); + changes.put(vm, newState); + } else if (oldState == State.Starting) { + if (newState == State.Running) { + _vms.put(vm, newState); + } else if (newState == State.Stopped) { + s_logger.debug("Ignoring vm " + vm + + " because of a lag in starting the vm."); + } + } else if (oldState == State.Migrating) { + if (newState == State.Running) { + s_logger.debug("Detected that an migrating VM is now running: " + + vm); + _vms.put(vm, newState); + } + } else if (oldState == State.Stopping) { + if (newState == State.Stopped) { + _vms.put(vm, newState); + } else if (newState == State.Running) { + s_logger.debug("Ignoring vm " + vm + + " because of a lag in stopping the vm. "); + } + } else if (oldState != newState) { + _vms.put(vm, newState); + if (newState == State.Stopped) { + if (_vmsKilled.remove(vm)) { + s_logger.debug("VM " + vm + + " has been killed for storage. "); + newState = State.Error; + } + } + changes.put(vm, newState); + } + } + + for (final Map.Entry entry : oldStates.entrySet()) { + final String vm = entry.getKey(); + final State oldState = entry.getValue(); + + if (s_logger.isTraceEnabled()) { + s_logger.trace("VM " + + vm + + " is now missing from libvirt so reporting stopped"); + } + + if (oldState == State.Stopping) { + s_logger.debug("Ignoring VM " + vm + + " in transition state stopping."); + _vms.remove(vm); + } else if (oldState == State.Starting) { + s_logger.debug("Ignoring VM " + vm + + " in transition state starting."); + } else if (oldState == State.Stopped) { + _vms.remove(vm); + } else if (oldState == State.Migrating) { + s_logger.debug("Ignoring VM " + vm + " in migrating state."); + } else { + _vms.remove(vm); + State state = State.Stopped; + if (_vmsKilled.remove(entry.getKey())) { + s_logger.debug("VM " + vm + + " has been killed by storage monitor"); + state = State.Error; + } + changes.put(entry.getKey(), state); + } + } + } + + return changes; + } + + protected State getRealPowerState(String vm) { + int i = 0; + s_logger.trace("Checking on the HALTED State"); + Domain dm = null; + for (; i < 5; i++) { + try { + Connect conn = LibvirtConnection.getConnection(); + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vm + .getBytes())); + DomainInfo.DomainState vps = dm.getInfo().state; + if (vps != null + && vps != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF + && vps != DomainInfo.DomainState.VIR_DOMAIN_NOSTATE) { + return convertToState(vps); + } + } catch (final LibvirtException e) { + s_logger.trace(e.getMessage()); + } catch (Exception e) { + s_logger.trace(e.getMessage()); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (final LibvirtException e) { + + } + } + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } + return State.Stopped; + } + + protected List getAllVmNames(Connect conn) { + ArrayList la = new ArrayList(); + try { + final String names[] = conn.listDefinedDomains(); + for (int i = 0; i < names.length; i++) { + la.add(names[i]); + } + } catch (final LibvirtException e) { + s_logger.warn("Failed to list Defined domains", e); + } + + int[] ids = null; + try { + ids = conn.listDomains(); + } catch (final LibvirtException e) { + s_logger.warn("Failed to list domains", e); + return la; + } + + Domain dm = null; + for (int i = 0; i < ids.length; i++) { + try { + dm = conn.domainLookupByID(ids[i]); + la.add(dm.getName()); + } catch (final LibvirtException e) { + s_logger.warn("Unable to get vms", e); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (final LibvirtException e) { + + } + } + } + + return la; + } + + private HashMap getAllVms() { + final HashMap vmStates = new HashMap(); + + String[] vms = null; + int[] ids = null; + Connect conn = null; + try { + conn = LibvirtConnection.getConnection(); + } catch (LibvirtException e) { + s_logger.debug("Failed to get connection: " + e.getMessage()); + return vmStates; + } + + try { + ids = conn.listDomains(); + } catch (final LibvirtException e) { + s_logger.warn("Unable to listDomains", e); + return null; + } + try { + vms = conn.listDefinedDomains(); + } catch (final LibvirtException e) { + s_logger.warn("Unable to listDomains", e); + return null; + } + + Domain dm = null; + for (int i = 0; i < ids.length; i++) { + try { + dm = conn.domainLookupByID(ids[i]); + + DomainInfo.DomainState ps = dm.getInfo().state; + + final State state = convertToState(ps); + + s_logger.trace("VM " + dm.getName() + ": powerstate = " + ps + + "; vm state=" + state.toString()); + String vmName = dm.getName(); + vmStates.put(vmName, state); + } catch (final LibvirtException e) { + s_logger.warn("Unable to get vms", e); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException e) { + + } + } + } + + for (int i = 0; i < vms.length; i++) { + try { + + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vms[i] + .getBytes())); + + DomainInfo.DomainState ps = dm.getInfo().state; + final State state = convertToState(ps); + String vmName = dm.getName(); + s_logger.trace("VM " + vmName + ": powerstate = " + ps + + "; vm state=" + state.toString()); + + vmStates.put(vmName, state); + } catch (final LibvirtException e) { + s_logger.warn("Unable to get vms", e); + } catch (Exception e) { + s_logger.warn("Unable to get vms", e); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException e) { + + } + } + } + + return vmStates; + } + + protected List getHostInfo() { + final ArrayList info = new ArrayList(); + long speed = 0; + long cpus = 0; + long ram = 0; + String cap = null; + try { + Connect conn = LibvirtConnection.getConnection(); + final NodeInfo hosts = conn.nodeInfo(); + boolean result = false; + try { + BufferedReader in = new BufferedReader( + new FileReader( + "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")); + speed = Long.parseLong(in.readLine()) / 1000; + result = true; + } catch (FileNotFoundException e) { + + } catch (IOException e) { + + } catch (NumberFormatException e) { + + } + + if (!result) { + speed = hosts.mhz; + } + + cpus = hosts.cpus; + ram = hosts.memory * 1024L; + LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); + parser.parseCapabilitiesXML(conn.getCapabilities()); + ArrayList oss = parser.getGuestOsType(); + for (String s : oss) { + /* + * Even host supports guest os type more than hvm, we only + * report hvm to management server + */ + if (s.equalsIgnoreCase("hvm")) { + cap = "hvm"; + } + } + } catch (LibvirtException e) { + + } + + if (isSnapshotSupported()) { + cap = cap + ",snapshot"; + } + + info.add((int) cpus); + info.add(speed); + info.add(ram); + info.add(cap); + long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L);// save a maximum + // of 10% of + // system ram or + // 768M + dom0ram = Math.max(dom0ram, _dom0MinMem); + info.add(dom0ram); + s_logger.debug("cpus=" + cpus + ", speed=" + speed + ", ram=" + ram + + ", dom0ram=" + dom0ram); + + return info; + } + + protected void cleanupVM(Connect conn, final String vmName, + final String vnet) { + s_logger.debug("Trying to cleanup the vnet: " + vnet); + if (vnet != null) { + cleanupVnet(conn, vnet); + } + + _vmStats.remove(vmName); + } + + protected String rebootVM(Connect conn, String vmName) { + Domain dm = null; + String msg = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + String vmDef = dm.getXMLDesc(0); + s_logger.debug(vmDef); + msg = stopVM(conn, vmName, defineOps.UNDEFINE_VM); + msg = startDomain(conn, vmName, vmDef); + return null; + } catch (LibvirtException e) { + s_logger.warn("Failed to create vm", e); + msg = e.getMessage(); + } catch (Exception e) { + s_logger.warn("Failed to create vm", e); + msg = e.getMessage(); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException e) { + + } + } + + return msg; + } + + protected String stopVM(Connect conn, String vmName, defineOps df) { + DomainInfo.DomainState state = null; + Domain dm = null; + + s_logger.debug("Try to stop the vm at first"); + String ret = stopVM(conn, vmName, false); + if (ret == Script.ERR_TIMEOUT) { + ret = stopVM(conn, vmName, true); + } else if (ret != null) { + /* + * There is a race condition between libvirt and qemu: libvirt + * listens on qemu's monitor fd. If qemu is shutdown, while libvirt + * is reading on the fd, then libvirt will report an error. + */ + /* Retry 3 times, to make sure we can get the vm's status */ + for (int i = 0; i < 3; i++) { + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + state = dm.getInfo().state; + break; + } catch (LibvirtException e) { + s_logger.debug("Failed to get vm status:" + e.getMessage()); + } catch (Exception e) { + s_logger.debug("Failed to get vm status:" + e.getMessage()); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException l) { + + } + } + } + + if (state == null) { + s_logger.debug("Can't get vm's status, assume it's dead already"); + return null; + } + + if (state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) { + s_logger.debug("Try to destroy the vm"); + ret = stopVM(conn, vmName, true); + if (ret != null) { + return ret; + } + } + } + + if (df == defineOps.UNDEFINE_VM) { + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + dm.undefine(); + } catch (LibvirtException e) { + + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException l) { + + } + } + } + return null; + } + + protected String stopVM(Connect conn, String vmName, boolean force) { + Domain dm = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + if (force) { + if (dm.getInfo().state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) { + dm.destroy(); + } + } else { + if (dm.getInfo().state == DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) { + return null; + } + dm.shutdown(); + int retry = _stopTimeout / 2000; + /* Wait for the domain gets into shutoff state */ + while ((dm.getInfo().state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) + && (retry >= 0)) { + Thread.sleep(2000); + retry--; + } + if (retry < 0) { + s_logger.warn("Timed out waiting for domain " + vmName + + " to shutdown gracefully"); + return Script.ERR_TIMEOUT; + } + } + } catch (LibvirtException e) { + s_logger.debug("Failed to stop VM :" + vmName + " :", e); + return e.getMessage(); + } catch (InterruptedException ie) { + s_logger.debug("Interrupted sleep"); + return ie.getMessage(); + } catch (Exception e) { + s_logger.debug("Failed to stop VM :" + vmName + " :", e); + return e.getMessage(); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException e) { + } + } + + return null; + } + + public synchronized String cleanupVnet(Connect conn, final String vnetId) { + // VNC proxy VMs do not have vnet + if (vnetId == null || vnetId.isEmpty() + || isDirectAttachedNetwork(vnetId)) { + return null; + } + + final List names = getAllVmNames(conn); + + if (!names.isEmpty()) { + for (final String name : names) { + if (VirtualMachineName.getVnet(name).equals(vnetId)) { + return null; // Can't remove the vnet yet. + } + } + } + + final Script command = new Script(_modifyVlanPath, _timeout, s_logger); + command.add("-o", "delete"); + command.add("-v", vnetId); + return command.execute(); + } + + protected Integer getVncPort(Connect conn, String vmName) + throws LibvirtException { + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + Domain dm = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + String xmlDesc = dm.getXMLDesc(0); + parser.parseDomainXML(xmlDesc); + return parser.getVncPort(); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException l) { + + } + } + } + + private boolean IsHVMEnabled(Connect conn) { + LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); + try { + parser.parseCapabilitiesXML(conn.getCapabilities()); + ArrayList osTypes = parser.getGuestOsType(); + for (String o : osTypes) { + if (o.equalsIgnoreCase("hvm")) { + return true; + } + } + } catch (LibvirtException e) { + + } + return false; + } + + private String getHypervisorPath(Connect conn) { + File f = new File("/usr/bin/cloud-qemu-kvm"); + if (f.exists()) { + return "/usr/bin/cloud-qemu-kvm"; + } else { + f = new File("/usr/libexec/cloud-qemu-kvm"); + if (f.exists()) { + return "/usr/libexec/cloud-qemu-kvm"; + } + + LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); + try { + parser.parseCapabilitiesXML(conn.getCapabilities()); + } catch (LibvirtException e) { + + } + return parser.getEmulator(); + } + } + + private String getGuestType(Connect conn, String vmName) { + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + Domain dm = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + String xmlDesc = dm.getXMLDesc(0); + parser.parseDomainXML(xmlDesc); + return parser.getDescription(); + } catch (LibvirtException e) { + return null; + } catch (Exception e) { + return null; + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException l) { + + } + } + } + + private boolean isGuestPVEnabled(String guestOS) { + if (guestOS == null) { + return false; + } + String guestOSName = KVMGuestOsMapper.getGuestOsName(guestOS); + if (guestOS.startsWith("Ubuntu") + || guestOSName.startsWith("Fedora 13") + || guestOSName.startsWith("Fedora 12") + || guestOSName.startsWith("Fedora 11") + || guestOSName.startsWith("Fedora 10") + || guestOSName.startsWith("Fedora 9") + || guestOSName.startsWith("CentOS 5.3") + || guestOSName.startsWith("CentOS 5.4") + || guestOSName.startsWith("CentOS 5.5") + || guestOS.startsWith("CentOS") + || guestOS.startsWith("Fedora") + || guestOSName.startsWith("Red Hat Enterprise Linux 5.3") + || guestOSName.startsWith("Red Hat Enterprise Linux 5.4") + || guestOSName.startsWith("Red Hat Enterprise Linux 5.5") + || guestOSName.startsWith("Red Hat Enterprise Linux 6") + || guestOS.startsWith("Debian GNU/Linux") + || guestOSName.startsWith("Other PV")) { + return true; + } else { + return false; + } + } + + public boolean isCentosHost() { + if (_hvVersion <= 9) { + return true; + } else { + return false; + } + } + + private InterfaceDef.nicModel getGuestNicModel(String guestOSType) { + if (isGuestPVEnabled(guestOSType)) { + return InterfaceDef.nicModel.VIRTIO; + } else { + return InterfaceDef.nicModel.E1000; + } + } + + private DiskDef.diskBus getGuestDiskModel(String guestOSType) { + if (isGuestPVEnabled(guestOSType)) { + return DiskDef.diskBus.VIRTIO; + } else { + return DiskDef.diskBus.IDE; + } + } + + private String setVnetBrName(String vnetId) { + return "cloudVirBr" + vnetId; + } + + private String getVnetIdFromBrName(String vnetBrName) { + return vnetBrName.replaceAll("cloudVirBr", ""); + } + + private void cleanupVMNetworks(Connect conn, List nics) { + for (InterfaceDef nic : nics) { + if (nic.getHostNetType() == hostNicType.VNET) { + cleanupVnet(conn, getVnetIdFromBrName(nic.getBrName())); + } + } + } + + private Domain getDomain(Connect conn, String vmName) + throws LibvirtException { + return conn + .domainLookupByUUID(UUID.nameUUIDFromBytes(vmName.getBytes())); + } + + protected List getInterfaces(Connect conn, String vmName) { + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + Domain dm = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + parser.parseDomainXML(dm.getXMLDesc(0)); + return parser.getInterfaces(); + + } catch (LibvirtException e) { + s_logger.debug("Failed to get dom xml: " + e.toString()); + return new ArrayList(); + } catch (Exception e) { + s_logger.debug("Failed to get dom xml: " + e.toString()); + return new ArrayList(); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException e) { + + } + } + } + + protected List getDisks(Connect conn, String vmName) { + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + Domain dm = null; + try { + dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName + .getBytes())); + parser.parseDomainXML(dm.getXMLDesc(0)); + return parser.getDisks(); + + } catch (LibvirtException e) { + s_logger.debug("Failed to get dom xml: " + e.toString()); + return new ArrayList(); + } catch (Exception e) { + s_logger.debug("Failed to get dom xml: " + e.toString()); + return new ArrayList(); + } finally { + try { + if (dm != null) { + dm.free(); + } + } catch (LibvirtException e) { + + } + } + } + + private String executeBashScript(String script) { + Script command = new Script("/bin/bash", _timeout, s_logger); + command.add("-c"); + command.add(script); + return command.execute(); + } + + private String executeBashScript(String script, OutputInterpreter parser) { + Script command = new Script("/bin/bash", _timeout, s_logger); + command.add("-c"); + command.add(script); + return command.execute(parser); + } + + private void deletExitingLinkLocalRoutTable(String linkLocalBr) { + Script command = new Script("/bin/bash", _timeout); + command.add("-c"); + command.add("ip route | grep " + NetUtils.getLinkLocalCIDR()); + OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser(); + String result = command.execute(parser); + boolean foundLinkLocalBr = false; + if (result == null && parser.getLines() != null) { + String[] lines = parser.getLines().split("\\n"); + for (String line : lines) { + String[] tokens = line.split(" "); + if (!tokens[2].equalsIgnoreCase(linkLocalBr)) { + Script.runSimpleBashScript("ip route del " + + NetUtils.getLinkLocalCIDR()); + } else { + foundLinkLocalBr = true; + } + } + } + if (!foundLinkLocalBr) { + Script.runSimpleBashScript("ip route add " + + NetUtils.getLinkLocalCIDR() + " dev " + linkLocalBr + + " src " + NetUtils.getLinkLocalGateway()); + } + } + + private class vmStats { + long _usedTime; + long _tx; + long _rx; + Calendar _timestamp; + } + + private VmStatsEntry getVmStat(Connect conn, String vmName) + throws LibvirtException { + Domain dm = null; + try { + dm = getDomain(conn, vmName); + DomainInfo info = dm.getInfo(); + + VmStatsEntry stats = new VmStatsEntry(); + stats.setNumCPUs(info.nrVirtCpu); + stats.setEntityType("vm"); + + /* get cpu utilization */ + vmStats oldStats = null; + + Calendar now = Calendar.getInstance(); + + oldStats = _vmStats.get(vmName); + + long elapsedTime = 0; + if (oldStats != null) { + elapsedTime = now.getTimeInMillis() + - oldStats._timestamp.getTimeInMillis(); + double utilization = (info.cpuTime - oldStats._usedTime) + / ((double) elapsedTime * 1000000); + + NodeInfo node = conn.nodeInfo(); + utilization = utilization / node.cpus; + stats.setCPUUtilization(utilization * 100); + } + + /* get network stats */ + + List vifs = getInterfaces(conn, vmName); + long rx = 0; + long tx = 0; + for (InterfaceDef vif : vifs) { + DomainInterfaceStats ifStats = dm.interfaceStats(vif + .getDevName()); + rx += ifStats.rx_bytes; + tx += ifStats.tx_bytes; + } + + if (oldStats != null) { + long deltarx = rx - oldStats._rx; + if (deltarx > 0) + stats.setNetworkReadKBs(deltarx / 1000); + long deltatx = tx - oldStats._tx; + if (deltatx > 0) + stats.setNetworkWriteKBs(deltatx / 1000); + } + + vmStats newStat = new vmStats(); + newStat._usedTime = info.cpuTime; + newStat._rx = rx; + newStat._tx = tx; + newStat._timestamp = now; + _vmStats.put(vmName, newStat); + return stats; + } finally { + if (dm != null) { + dm.free(); + } + } + } + + private boolean can_bridge_firewall(String prvNic) { + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("can_bridge_firewall"); + cmd.add(prvNic); + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + protected boolean destroy_network_rules_for_vm(Connect conn, String vmName) { + if (!_can_bridge_firewall) { + return false; + } + String vif = null; + List intfs = getInterfaces(conn, vmName); + if (intfs.size() > 0) { + InterfaceDef intf = intfs.get(0); + vif = intf.getDevName(); + } + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("destroy_network_rules_for_vm"); + cmd.add("--vmname", vmName); + if (vif != null) { + cmd.add("--vif", vif); + } + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + protected boolean default_network_rules(Connect conn, String vmName, + NicTO nic, Long vmId) { + if (!_can_bridge_firewall) { + return false; + } + + List intfs = getInterfaces(conn, vmName); + if (intfs.size() < nic.getDeviceId()) { + return false; + } + + InterfaceDef intf = intfs.get(nic.getDeviceId()); + String brname = intf.getBrName(); + String vif = intf.getDevName(); + + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("default_network_rules"); + cmd.add("--vmname", vmName); + cmd.add("--vmid", vmId.toString()); + if (nic.getIp() != null) { + cmd.add("--vmip", nic.getIp()); + } + cmd.add("--vmmac", nic.getMac()); + cmd.add("--vif", vif); + cmd.add("--brname", brname); + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + protected boolean post_default_network_rules(Connect conn, String vmName, + NicTO nic, Long vmId, InetAddress dhcpServerIp, String hostIp, + String hostMacAddr) { + if (!_can_bridge_firewall) { + return false; + } + + List intfs = getInterfaces(conn, vmName); + if (intfs.size() < nic.getDeviceId()) { + return false; + } + + InterfaceDef intf = intfs.get(nic.getDeviceId()); + String brname = intf.getBrName(); + String vif = intf.getDevName(); + + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("post_default_network_rules"); + cmd.add("--vmname", vmName); + cmd.add("--vmid", vmId.toString()); + cmd.add("--vmip", nic.getIp()); + cmd.add("--vmmac", nic.getMac()); + cmd.add("--vif", vif); + cmd.add("--brname", brname); + if (dhcpServerIp != null) + cmd.add("--dhcpSvr", dhcpServerIp.getHostAddress()); + + cmd.add("--hostIp", hostIp); + cmd.add("--hostMacAddr", hostMacAddr); + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + protected boolean default_network_rules_for_systemvm(Connect conn, + String vmName) { + if (!_can_bridge_firewall) { + return false; + } + + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("default_network_rules_systemvm"); + cmd.add("--vmname", vmName); + cmd.add("--localbrname", _linkLocalBridgeName); + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + private boolean add_network_rules(String vmName, String vmId, + String guestIP, String sig, String seq, String mac, String rules, + String vif, String brname) { + if (!_can_bridge_firewall) { + return false; + } + + String newRules = rules.replace(" ", ";"); + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("add_network_rules"); + cmd.add("--vmname", vmName); + cmd.add("--vmid", vmId); + cmd.add("--vmip", guestIP); + cmd.add("--sig", sig); + cmd.add("--seq", seq); + cmd.add("--vmmac", mac); + cmd.add("--vif", vif); + cmd.add("--brname", brname); + if (rules != null) { + cmd.add("--rules", newRules); + } + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + private boolean cleanup_rules() { + if (!_can_bridge_firewall) { + return false; + } + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("cleanup_rules"); + String result = cmd.execute(); + if (result != null) { + return false; + } + return true; + } + + private String get_rule_logs_for_vms() { + Script cmd = new Script(_securityGroupPath, _timeout, s_logger); + cmd.add("get_rule_logs_for_vms"); + OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); + String result = cmd.execute(parser); + if (result == null) { + return parser.getLine(); + } + return null; + } + + private HashMap> syncNetworkGroups(long id) { + HashMap> states = new HashMap>(); + + String result = get_rule_logs_for_vms(); + s_logger.trace("syncNetworkGroups: id=" + id + " got: " + result); + String[] rulelogs = result != null ? result.split(";") : new String[0]; + for (String rulesforvm : rulelogs) { + String[] log = rulesforvm.split(","); + if (log.length != 6) { + continue; + } + try { + states.put(log[0], new Pair(Long.parseLong(log[1]), + Long.parseLong(log[5]))); + } catch (NumberFormatException nfe) { + states.put(log[0], new Pair(-1L, -1L)); + } + } + return states; + } + + /* online snapshot supported by enhanced qemu-kvm */ + private boolean isSnapshotSupported() { + String result = executeBashScript("qemu-img --help|grep convert |grep snapshot"); + if (result != null) { + return false; + } else { + return true; + } + } + + private Pair getNicStats(String nicName) { + double rx = 0.0; + OutputInterpreter.OneLineParser rxParser = new OutputInterpreter.OneLineParser(); + String result = executeBashScript("cat /sys/class/net/" + nicName + + "/statistics/rx_bytes", rxParser); + if (result == null && rxParser.getLine() != null) { + rx = Double.parseDouble(rxParser.getLine()); + } + + double tx = 0.0; + OutputInterpreter.OneLineParser txParser = new OutputInterpreter.OneLineParser(); + result = executeBashScript("cat /sys/class/net/" + nicName + + "/statistics/tx_bytes", txParser); + if (result == null && txParser.getLine() != null) { + tx = Double.parseDouble(txParser.getLine()); + } + + return new Pair(rx, tx); + } + + private void createControlNetwork(Connect conn) throws LibvirtException { + _virtRouterResource.createControlNetwork(_linkLocalBridgeName); + } + + private Answer execute(NetworkRulesSystemVmCommand cmd) { + boolean success = false; + Connect conn; + try { + conn = LibvirtConnection.getConnection(); + success = default_network_rules_for_systemvm(conn, cmd.getVmName()); + } catch (LibvirtException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return new Answer(cmd, success, ""); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtConnection.java b/agent/src/com/cloud/agent/resource/computing/LibvirtConnection.java index 874ad983309..d3a231871bb 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtConnection.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtConnection.java @@ -21,28 +21,28 @@ import org.libvirt.Connect; import org.libvirt.LibvirtException; public class LibvirtConnection { - private static final Logger s_logger = Logger - .getLogger(LibvirtConnection.class); - static private Connect _connection; - static private String _hypervisorURI; + private static final Logger s_logger = Logger + .getLogger(LibvirtConnection.class); + static private Connect _connection; + static private String _hypervisorURI; - static public Connect getConnection() throws LibvirtException { - if (_connection == null) { - _connection = new Connect(_hypervisorURI, false); - } else { - try { - _connection.getVersion(); - } catch (LibvirtException e) { - s_logger.debug("Connection with libvirtd is broken, due to " - + e.getMessage()); - _connection = new Connect(_hypervisorURI, false); - } - } + static public Connect getConnection() throws LibvirtException { + if (_connection == null) { + _connection = new Connect(_hypervisorURI, false); + } else { + try { + _connection.getVersion(); + } catch (LibvirtException e) { + s_logger.debug("Connection with libvirtd is broken, due to " + + e.getMessage()); + _connection = new Connect(_hypervisorURI, false); + } + } - return _connection; - } + return _connection; + } - static void initialize(String hypervisorURI) { - _hypervisorURI = hypervisorURI; - } + static void initialize(String hypervisorURI) { + _hypervisorURI = hypervisorURI; + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtDomainXMLParser.java b/agent/src/com/cloud/agent/resource/computing/LibvirtDomainXMLParser.java index f51d7ae8278..62155349b66 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtDomainXMLParser.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtDomainXMLParser.java @@ -45,209 +45,209 @@ import com.cloud.agent.resource.computing.LibvirtVMDef.InterfaceDef.nicModel; * */ public class LibvirtDomainXMLParser { - private static final Logger s_logger = Logger - .getLogger(LibvirtDomainXMLParser.class); - private final List interfaces = new ArrayList(); - private final List diskDefs = new ArrayList(); - private Integer vncPort; - private String desc; + private static final Logger s_logger = Logger + .getLogger(LibvirtDomainXMLParser.class); + private final List interfaces = new ArrayList(); + private final List diskDefs = new ArrayList(); + private Integer vncPort; + private String desc; - public boolean parseDomainXML(String domXML) { - DocumentBuilder builder; - try { - builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + public boolean parseDomainXML(String domXML) { + DocumentBuilder builder; + try { + builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(domXML)); - Document doc = builder.parse(is); + InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(domXML)); + Document doc = builder.parse(is); - Element rootElement = doc.getDocumentElement(); + Element rootElement = doc.getDocumentElement(); - desc = getTagValue("description", rootElement); + desc = getTagValue("description", rootElement); - Element devices = (Element) rootElement.getElementsByTagName( - "devices").item(0); - NodeList disks = devices.getElementsByTagName("disk"); - for (int i = 0; i < disks.getLength(); i++) { - Element disk = (Element) disks.item(i); - String diskFmtType = getAttrValue("driver", "type", disk); - String diskFile = getAttrValue("source", "file", disk); - String diskDev = getAttrValue("source", "dev", disk); + Element devices = (Element) rootElement.getElementsByTagName( + "devices").item(0); + NodeList disks = devices.getElementsByTagName("disk"); + for (int i = 0; i < disks.getLength(); i++) { + Element disk = (Element) disks.item(i); + String diskFmtType = getAttrValue("driver", "type", disk); + String diskFile = getAttrValue("source", "file", disk); + String diskDev = getAttrValue("source", "dev", disk); - String diskLabel = getAttrValue("target", "dev", disk); - String bus = getAttrValue("target", "bus", disk); - String type = disk.getAttribute("type"); - String device = disk.getAttribute("device"); + String diskLabel = getAttrValue("target", "dev", disk); + String bus = getAttrValue("target", "bus", disk); + String type = disk.getAttribute("type"); + String device = disk.getAttribute("device"); - DiskDef def = new DiskDef(); - if (type.equalsIgnoreCase("file")) { - if (device.equalsIgnoreCase("disk")) { - DiskDef.diskFmtType fmt = null; - if (diskFmtType != null) { - fmt = DiskDef.diskFmtType.valueOf(diskFmtType - .toUpperCase()); - } - def.defFileBasedDisk(diskFile, diskLabel, - DiskDef.diskBus.valueOf(bus.toUpperCase()), fmt); - } else if (device.equalsIgnoreCase("cdrom")) { - def.defISODisk(diskFile); - } - } else if (type.equalsIgnoreCase("block")) { - def.defBlockBasedDisk(diskDev, diskLabel, - DiskDef.diskBus.valueOf(bus.toUpperCase())); - } - diskDefs.add(def); - } + DiskDef def = new DiskDef(); + if (type.equalsIgnoreCase("file")) { + if (device.equalsIgnoreCase("disk")) { + DiskDef.diskFmtType fmt = null; + if (diskFmtType != null) { + fmt = DiskDef.diskFmtType.valueOf(diskFmtType + .toUpperCase()); + } + def.defFileBasedDisk(diskFile, diskLabel, + DiskDef.diskBus.valueOf(bus.toUpperCase()), fmt); + } else if (device.equalsIgnoreCase("cdrom")) { + def.defISODisk(diskFile); + } + } else if (type.equalsIgnoreCase("block")) { + def.defBlockBasedDisk(diskDev, diskLabel, + DiskDef.diskBus.valueOf(bus.toUpperCase())); + } + diskDefs.add(def); + } - NodeList nics = devices.getElementsByTagName("interface"); - for (int i = 0; i < nics.getLength(); i++) { - Element nic = (Element) nics.item(i); + NodeList nics = devices.getElementsByTagName("interface"); + for (int i = 0; i < nics.getLength(); i++) { + Element nic = (Element) nics.item(i); - String type = nic.getAttribute("type"); - String mac = getAttrValue("mac", "address", nic); - String dev = getAttrValue("target", "dev", nic); - String model = getAttrValue("model", "type", nic); - InterfaceDef def = new InterfaceDef(); + String type = nic.getAttribute("type"); + String mac = getAttrValue("mac", "address", nic); + String dev = getAttrValue("target", "dev", nic); + String model = getAttrValue("model", "type", nic); + InterfaceDef def = new InterfaceDef(); - if (type.equalsIgnoreCase("network")) { - String network = getAttrValue("source", "network", nic); - def.defPrivateNet(network, dev, mac, - nicModel.valueOf(model.toUpperCase())); - } else if (type.equalsIgnoreCase("bridge")) { - String bridge = getAttrValue("source", "bridge", nic); - def.defBridgeNet(bridge, dev, mac, - nicModel.valueOf(model.toUpperCase())); - } - interfaces.add(def); - } + if (type.equalsIgnoreCase("network")) { + String network = getAttrValue("source", "network", nic); + def.defPrivateNet(network, dev, mac, + nicModel.valueOf(model.toUpperCase())); + } else if (type.equalsIgnoreCase("bridge")) { + String bridge = getAttrValue("source", "bridge", nic); + def.defBridgeNet(bridge, dev, mac, + nicModel.valueOf(model.toUpperCase())); + } + interfaces.add(def); + } - Element graphic = (Element) devices - .getElementsByTagName("graphics").item(0); - String port = graphic.getAttribute("port"); - if (port != null) { - try { - vncPort = Integer.parseInt(port); - if (vncPort != -1) { - vncPort = vncPort - 5900; - } else { - vncPort = null; - } - } catch (NumberFormatException nfe) { - vncPort = null; - } - } + Element graphic = (Element) devices + .getElementsByTagName("graphics").item(0); + String port = graphic.getAttribute("port"); + if (port != null) { + try { + vncPort = Integer.parseInt(port); + if (vncPort != -1) { + vncPort = vncPort - 5900; + } else { + vncPort = null; + } + } catch (NumberFormatException nfe) { + vncPort = null; + } + } - return true; - } catch (ParserConfigurationException e) { - s_logger.debug(e.toString()); - } catch (SAXException e) { - s_logger.debug(e.toString()); - } catch (IOException e) { - s_logger.debug(e.toString()); - } - return false; - } + return true; + } catch (ParserConfigurationException e) { + s_logger.debug(e.toString()); + } catch (SAXException e) { + s_logger.debug(e.toString()); + } catch (IOException e) { + s_logger.debug(e.toString()); + } + return false; + } - private static String getTagValue(String tag, Element eElement) { - NodeList tagNodeList = eElement.getElementsByTagName(tag); - if (tagNodeList == null || tagNodeList.getLength() == 0) { - return null; - } + private static String getTagValue(String tag, Element eElement) { + NodeList tagNodeList = eElement.getElementsByTagName(tag); + if (tagNodeList == null || tagNodeList.getLength() == 0) { + return null; + } - NodeList nlList = tagNodeList.item(0).getChildNodes(); + NodeList nlList = tagNodeList.item(0).getChildNodes(); - Node nValue = (Node) nlList.item(0); + Node nValue = (Node) nlList.item(0); - return nValue.getNodeValue(); - } + return nValue.getNodeValue(); + } - private static String getAttrValue(String tag, String attr, Element eElement) { - NodeList tagNode = eElement.getElementsByTagName(tag); - if (tagNode.getLength() == 0) { - return null; - } - Element node = (Element) tagNode.item(0); - return node.getAttribute(attr); - } + private static String getAttrValue(String tag, String attr, Element eElement) { + NodeList tagNode = eElement.getElementsByTagName(tag); + if (tagNode.getLength() == 0) { + return null; + } + Element node = (Element) tagNode.item(0); + return node.getAttribute(attr); + } - public Integer getVncPort() { - return vncPort; - } + public Integer getVncPort() { + return vncPort; + } - public List getInterfaces() { - return interfaces; - } + public List getInterfaces() { + return interfaces; + } - public List getDisks() { - return diskDefs; - } + public List getDisks() { + return diskDefs; + } - public String getDescription() { - return desc; - } + public String getDescription() { + return desc; + } - public static void main(String[] args) { - LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); - parser.parseDomainXML("" - + "r-6-CV-5002-1" - + "581b5a4b-b496-8d4d-e44e-a7dcbe9df0b5" - + "testVM" - + "131072" - + "131072" - + "1" - + "" - + "hvm" - + "/var/lib/libvirt/qemu/vmlinuz-2.6.31.6-166.fc12.i686" - + "ro root=/dev/sda1 acpi=force selinux=0 eth0ip=10.1.1.1 eth0mask=255.255.255.0 eth2ip=192.168.10.152 eth2mask=255.255.255.0 gateway=192.168.10.1 dns1=72.52.126.11 dns2=72.52.126.12 domain=v4.myvm.com" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + "destroy" - + "restart" - + "destroy" - + "" - + "/usr/bin/qemu-kvm" - + "" - + "" - + "" - + "" + "" - + "" - + "" - + "" + "" - + "" + "" - + "" - + "" - + "" + "" - + "" + "" - + "" - + "" - + "" + "" - + "" + "" - + "" - + "" - + "" + "" + "" + public static void main(String[] args) { + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + parser.parseDomainXML("" + + "r-6-CV-5002-1" + + "581b5a4b-b496-8d4d-e44e-a7dcbe9df0b5" + + "testVM" + + "131072" + + "131072" + + "1" + + "" + + "hvm" + + "/var/lib/libvirt/qemu/vmlinuz-2.6.31.6-166.fc12.i686" + + "ro root=/dev/sda1 acpi=force selinux=0 eth0ip=10.1.1.1 eth0mask=255.255.255.0 eth2ip=192.168.10.152 eth2mask=255.255.255.0 gateway=192.168.10.1 dns1=72.52.126.11 dns2=72.52.126.12 domain=v4.myvm.com" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "destroy" + + "restart" + + "destroy" + + "" + + "/usr/bin/qemu-kvm" + + "" + + "" + + "" + + "" + "" + + "" + + "" + + "" + "" + + "" + "" + + "" + + "" + + "" + "" + + "" + "" + + "" + + "" + + "" + "" + + "" + "" + + "" + + "" + + "" + "" + "" - ); - for (InterfaceDef intf : parser.getInterfaces()) { - System.out.println(intf); - } - for (DiskDef disk : parser.getDisks()) { - System.out.println(disk); - } - System.out.println(parser.getVncPort()); - System.out.println(parser.getDescription()); + ); + for (InterfaceDef intf : parser.getInterfaces()) { + System.out.println(intf); + } + for (DiskDef disk : parser.getDisks()) { + System.out.println(disk); + } + System.out.println(parser.getVncPort()); + System.out.println(parser.getDescription()); - List test = new ArrayList(1); - test.add("1"); - test.add("2"); - if (test.contains("1")) { - System.out.print("fdf"); - } - } + List test = new ArrayList(1); + test.add("1"); + test.add("2"); + if (test.contains("1")) { + System.out.print("fdf"); + } + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtNetworkDef.java b/agent/src/com/cloud/agent/resource/computing/LibvirtNetworkDef.java index 4c3db464891..7f757dec967 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtNetworkDef.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtNetworkDef.java @@ -20,174 +20,174 @@ import java.util.ArrayList; import java.util.List; public class LibvirtNetworkDef { - enum netType { - BRIDGE, NAT, LOCAL - } + enum netType { + BRIDGE, NAT, LOCAL + } - private final String _networkName; - private final String _uuid; - private netType _networkType; - private String _brName; - private boolean _stp; - private int _delay; - private String _fwDev; - private final String _domainName; - private String _brIPAddr; - private String _brNetMask; - private final List ipranges = new ArrayList(); - private final List dhcpMaps = new ArrayList(); + private final String _networkName; + private final String _uuid; + private netType _networkType; + private String _brName; + private boolean _stp; + private int _delay; + private String _fwDev; + private final String _domainName; + private String _brIPAddr; + private String _brNetMask; + private final List ipranges = new ArrayList(); + private final List dhcpMaps = new ArrayList(); - public static class dhcpMapping { - String _mac; - String _name; - String _ip; + public static class dhcpMapping { + String _mac; + String _name; + String _ip; - public dhcpMapping(String mac, String name, String ip) { - _mac = mac; - _name = name; - _ip = ip; - } - } + public dhcpMapping(String mac, String name, String ip) { + _mac = mac; + _name = name; + _ip = ip; + } + } - public static class IPRange { - String _start; - String _end; + public static class IPRange { + String _start; + String _end; - public IPRange(String start, String end) { - _start = start; - _end = end; - } - } + public IPRange(String start, String end) { + _start = start; + _end = end; + } + } - public LibvirtNetworkDef(String netName, String uuid, String domName) { - _networkName = netName; - _uuid = uuid; - _domainName = domName; - } + public LibvirtNetworkDef(String netName, String uuid, String domName) { + _networkName = netName; + _uuid = uuid; + _domainName = domName; + } - public void defNATNetwork(String brName, boolean stp, int delay, - String fwNic, String ipAddr, String netMask) { - _networkType = netType.NAT; - _brName = brName; - _stp = stp; - _delay = delay; - _fwDev = fwNic; - _brIPAddr = ipAddr; - _brNetMask = netMask; - } + public void defNATNetwork(String brName, boolean stp, int delay, + String fwNic, String ipAddr, String netMask) { + _networkType = netType.NAT; + _brName = brName; + _stp = stp; + _delay = delay; + _fwDev = fwNic; + _brIPAddr = ipAddr; + _brNetMask = netMask; + } - public void defBrNetwork(String brName, boolean stp, int delay, - String fwNic, String ipAddr, String netMask) { - _networkType = netType.BRIDGE; - _brName = brName; - _stp = stp; - _delay = delay; - _fwDev = fwNic; - _brIPAddr = ipAddr; - _brNetMask = netMask; - } + public void defBrNetwork(String brName, boolean stp, int delay, + String fwNic, String ipAddr, String netMask) { + _networkType = netType.BRIDGE; + _brName = brName; + _stp = stp; + _delay = delay; + _fwDev = fwNic; + _brIPAddr = ipAddr; + _brNetMask = netMask; + } - public void defLocalNetwork(String brName, boolean stp, int delay, - String ipAddr, String netMask) { - _networkType = netType.LOCAL; - _brName = brName; - _stp = stp; - _delay = delay; - _brIPAddr = ipAddr; - _brNetMask = netMask; - } + public void defLocalNetwork(String brName, boolean stp, int delay, + String ipAddr, String netMask) { + _networkType = netType.LOCAL; + _brName = brName; + _stp = stp; + _delay = delay; + _brIPAddr = ipAddr; + _brNetMask = netMask; + } - public void adddhcpIPRange(String start, String end) { - IPRange ipr = new IPRange(start, end); - ipranges.add(ipr); - } + public void adddhcpIPRange(String start, String end) { + IPRange ipr = new IPRange(start, end); + ipranges.add(ipr); + } - public void adddhcpMapping(String mac, String host, String ip) { - dhcpMapping map = new dhcpMapping(mac, host, ip); - dhcpMaps.add(map); - } + public void adddhcpMapping(String mac, String host, String ip) { + dhcpMapping map = new dhcpMapping(mac, host, ip); + dhcpMaps.add(map); + } - @Override - public String toString() { - StringBuilder netBuilder = new StringBuilder(); - netBuilder.append("\n"); - netBuilder.append("" + _networkName + "\n"); - if (_uuid != null) - netBuilder.append("" + _uuid + "\n"); - if (_brName != null) { - netBuilder.append("\n"); - } - if (_domainName != null) { - netBuilder.append("\n"); - } - if (_networkType == netType.BRIDGE) { - netBuilder.append("\n"); - } else if (_networkType == netType.NAT) { - netBuilder.append("\n"); - } - if (_brIPAddr != null || _brNetMask != null || !ipranges.isEmpty() - || !dhcpMaps.isEmpty()) { - netBuilder.append("\n"); + @Override + public String toString() { + StringBuilder netBuilder = new StringBuilder(); + netBuilder.append("\n"); + netBuilder.append("" + _networkName + "\n"); + if (_uuid != null) + netBuilder.append("" + _uuid + "\n"); + if (_brName != null) { + netBuilder.append("\n"); + } + if (_domainName != null) { + netBuilder.append("\n"); + } + if (_networkType == netType.BRIDGE) { + netBuilder.append("\n"); + } else if (_networkType == netType.NAT) { + netBuilder.append("\n"); + } + if (_brIPAddr != null || _brNetMask != null || !ipranges.isEmpty() + || !dhcpMaps.isEmpty()) { + netBuilder.append("\n"); - if (!ipranges.isEmpty() || !dhcpMaps.isEmpty()) { - netBuilder.append("\n"); - for (IPRange ip : ipranges) { - netBuilder.append("\n"); - } - for (dhcpMapping map : dhcpMaps) { - netBuilder.append("\n"); - } - netBuilder.append("\n"); - } - netBuilder.append("\n"); - } - netBuilder.append("\n"); - return netBuilder.toString(); - } + if (!ipranges.isEmpty() || !dhcpMaps.isEmpty()) { + netBuilder.append("\n"); + for (IPRange ip : ipranges) { + netBuilder.append("\n"); + } + for (dhcpMapping map : dhcpMaps) { + netBuilder.append("\n"); + } + netBuilder.append("\n"); + } + netBuilder.append("\n"); + } + netBuilder.append("\n"); + return netBuilder.toString(); + } - /** - * @param args - */ - public static void main(String[] args) { - LibvirtNetworkDef net = new LibvirtNetworkDef("cloudPrivate", null, - "cloud.com"); - net.defNATNetwork("cloudbr0", false, 0, null, "192.168.168.1", - "255.255.255.0"); - net.adddhcpIPRange("192.168.168.100", "192.168.168.220"); - net.adddhcpIPRange("192.168.168.10", "192.168.168.50"); - net.adddhcpMapping("branch0.cloud.com", "00:16:3e:77:e2:ed", - "192.168.168.100"); - net.adddhcpMapping("branch1.cloud.com", "00:16:3e:77:e2:ef", - "192.168.168.101"); - net.adddhcpMapping("branch2.cloud.com", "00:16:3e:77:e2:f0", - "192.168.168.102"); - System.out.println(net.toString()); + /** + * @param args + */ + public static void main(String[] args) { + LibvirtNetworkDef net = new LibvirtNetworkDef("cloudPrivate", null, + "cloud.com"); + net.defNATNetwork("cloudbr0", false, 0, null, "192.168.168.1", + "255.255.255.0"); + net.adddhcpIPRange("192.168.168.100", "192.168.168.220"); + net.adddhcpIPRange("192.168.168.10", "192.168.168.50"); + net.adddhcpMapping("branch0.cloud.com", "00:16:3e:77:e2:ed", + "192.168.168.100"); + net.adddhcpMapping("branch1.cloud.com", "00:16:3e:77:e2:ef", + "192.168.168.101"); + net.adddhcpMapping("branch2.cloud.com", "00:16:3e:77:e2:f0", + "192.168.168.102"); + System.out.println(net.toString()); - } + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolDef.java b/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolDef.java index 5e0a8416e25..582cd2e2e6d 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolDef.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolDef.java @@ -17,74 +17,74 @@ package com.cloud.agent.resource.computing; public class LibvirtStoragePoolDef { - public enum poolType { - ISCSI("iscsi"), NETFS("netfs"), LOGICAL("logical"), DIR("dir"); - String _poolType; + public enum poolType { + ISCSI("iscsi"), NETFS("netfs"), LOGICAL("logical"), DIR("dir"); + String _poolType; - poolType(String poolType) { - _poolType = poolType; - } + poolType(String poolType) { + _poolType = poolType; + } - @Override - public String toString() { - return _poolType; - } - } + @Override + public String toString() { + return _poolType; + } + } - private poolType _poolType; - private String _poolName; - private String _uuid; - private String _sourceHost; - private String _sourceDir; - private String _targetPath; + private poolType _poolType; + private String _poolName; + private String _uuid; + private String _sourceHost; + private String _sourceDir; + private String _targetPath; - public LibvirtStoragePoolDef(poolType type, String poolName, String uuid, - String host, String dir, String targetPath) { - _poolType = type; - _poolName = poolName; - _uuid = uuid; - _sourceHost = host; - _sourceDir = dir; - _targetPath = targetPath; - } + public LibvirtStoragePoolDef(poolType type, String poolName, String uuid, + String host, String dir, String targetPath) { + _poolType = type; + _poolName = poolName; + _uuid = uuid; + _sourceHost = host; + _sourceDir = dir; + _targetPath = targetPath; + } - public String getPoolName() { - return _poolName; - } + public String getPoolName() { + return _poolName; + } - public poolType getPoolType() { - return _poolType; - } + public poolType getPoolType() { + return _poolType; + } - public String getSourceHost() { - return _sourceHost; - } + public String getSourceHost() { + return _sourceHost; + } - public String getSourceDir() { - return _sourceDir; - } + public String getSourceDir() { + return _sourceDir; + } - public String getTargetPath() { - return _targetPath; - } + public String getTargetPath() { + return _targetPath; + } - @Override - public String toString() { - StringBuilder storagePoolBuilder = new StringBuilder(); - storagePoolBuilder.append("\n"); - storagePoolBuilder.append("" + _poolName + "\n"); - if (_uuid != null) - storagePoolBuilder.append("" + _uuid + "\n"); - if (_poolType == poolType.NETFS) { - storagePoolBuilder.append("\n"); - storagePoolBuilder.append("\n"); - storagePoolBuilder.append("\n"); - storagePoolBuilder.append("\n"); - } - storagePoolBuilder.append("\n"); - storagePoolBuilder.append("" + _targetPath + "\n"); - storagePoolBuilder.append("\n"); - storagePoolBuilder.append("\n"); - return storagePoolBuilder.toString(); - } + @Override + public String toString() { + StringBuilder storagePoolBuilder = new StringBuilder(); + storagePoolBuilder.append("\n"); + storagePoolBuilder.append("" + _poolName + "\n"); + if (_uuid != null) + storagePoolBuilder.append("" + _uuid + "\n"); + if (_poolType == poolType.NETFS) { + storagePoolBuilder.append("\n"); + storagePoolBuilder.append("\n"); + storagePoolBuilder.append("\n"); + storagePoolBuilder.append("\n"); + } + storagePoolBuilder.append("\n"); + storagePoolBuilder.append("" + _targetPath + "\n"); + storagePoolBuilder.append("\n"); + storagePoolBuilder.append("\n"); + return storagePoolBuilder.toString(); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolXMLParser.java b/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolXMLParser.java index 2adcfed579d..5c45d76e82d 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolXMLParser.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtStoragePoolXMLParser.java @@ -29,81 +29,81 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; public class LibvirtStoragePoolXMLParser { - private static final Logger s_logger = Logger - .getLogger(LibvirtStoragePoolXMLParser.class); + private static final Logger s_logger = Logger + .getLogger(LibvirtStoragePoolXMLParser.class); - public LibvirtStoragePoolDef parseStoragePoolXML(String poolXML) { - DocumentBuilder builder; - try { - builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + public LibvirtStoragePoolDef parseStoragePoolXML(String poolXML) { + DocumentBuilder builder; + try { + builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(poolXML)); - Document doc = builder.parse(is); + InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(poolXML)); + Document doc = builder.parse(is); - Element rootElement = doc.getDocumentElement(); - String type = rootElement.getAttribute("type"); + Element rootElement = doc.getDocumentElement(); + String type = rootElement.getAttribute("type"); - String uuid = getTagValue("uuid", rootElement); + String uuid = getTagValue("uuid", rootElement); - String poolName = getTagValue("name", rootElement); + String poolName = getTagValue("name", rootElement); - Element source = (Element) rootElement.getElementsByTagName( - "source").item(0); - String host = getAttrValue("host", "name", source); - String path = getAttrValue("dir", "path", source); + Element source = (Element) rootElement.getElementsByTagName( + "source").item(0); + String host = getAttrValue("host", "name", source); + String path = getAttrValue("dir", "path", source); - Element target = (Element) rootElement.getElementsByTagName( - "target").item(0); - String targetPath = getTagValue("path", target); + Element target = (Element) rootElement.getElementsByTagName( + "target").item(0); + String targetPath = getTagValue("path", target); - return new LibvirtStoragePoolDef( - LibvirtStoragePoolDef.poolType.valueOf(type.toUpperCase()), - poolName, uuid, host, path, targetPath); - } catch (ParserConfigurationException e) { - s_logger.debug(e.toString()); - } catch (SAXException e) { - s_logger.debug(e.toString()); - } catch (IOException e) { - s_logger.debug(e.toString()); - } - return null; - } + return new LibvirtStoragePoolDef( + LibvirtStoragePoolDef.poolType.valueOf(type.toUpperCase()), + poolName, uuid, host, path, targetPath); + } catch (ParserConfigurationException e) { + s_logger.debug(e.toString()); + } catch (SAXException e) { + s_logger.debug(e.toString()); + } catch (IOException e) { + s_logger.debug(e.toString()); + } + return null; + } - private static String getTagValue(String tag, Element eElement) { - NodeList nlList = eElement.getElementsByTagName(tag).item(0) - .getChildNodes(); - Node nValue = (Node) nlList.item(0); + private static String getTagValue(String tag, Element eElement) { + NodeList nlList = eElement.getElementsByTagName(tag).item(0) + .getChildNodes(); + Node nValue = (Node) nlList.item(0); - return nValue.getNodeValue(); - } + return nValue.getNodeValue(); + } - private static String getAttrValue(String tag, String attr, Element eElement) { - NodeList tagNode = eElement.getElementsByTagName(tag); - if (tagNode.getLength() == 0) { - return null; - } - Element node = (Element) tagNode.item(0); - return node.getAttribute(attr); - } + private static String getAttrValue(String tag, String attr, Element eElement) { + NodeList tagNode = eElement.getElementsByTagName(tag); + if (tagNode.getLength() == 0) { + return null; + } + Element node = (Element) tagNode.item(0); + return node.getAttribute(attr); + } - public static void main(String[] args) { - s_logger.addAppender(new org.apache.log4j.ConsoleAppender( - new org.apache.log4j.PatternLayout(), "System.out")); - String storagePool = "" + "test" - + "bf723c83-4b95-259c-7089-60776e61a11f" - + "20314165248" - + "1955450880" - + "18358714368" + "" - + "" - + "" - + "" + "" + "" - + "/media" + "" + "0700" - + "0" + "0" + "" - + "" + ""; + public static void main(String[] args) { + s_logger.addAppender(new org.apache.log4j.ConsoleAppender( + new org.apache.log4j.PatternLayout(), "System.out")); + String storagePool = "" + "test" + + "bf723c83-4b95-259c-7089-60776e61a11f" + + "20314165248" + + "1955450880" + + "18358714368" + "" + + "" + + "" + + "" + "" + "" + + "/media" + "" + "0700" + + "0" + "0" + "" + + "" + ""; - LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); - LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(storagePool); - s_logger.debug(pool.toString()); - } + LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); + LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(storagePool); + s_logger.debug(pool.toString()); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeDef.java b/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeDef.java index e00ecaa58a7..ef8e22e6008 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeDef.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeDef.java @@ -17,75 +17,75 @@ package com.cloud.agent.resource.computing; public class LibvirtStorageVolumeDef { - public enum volFormat { - RAW("raw"), QCOW2("qcow2"), DIR("dir"); - private String _format; + public enum volFormat { + RAW("raw"), QCOW2("qcow2"), DIR("dir"); + private String _format; - volFormat(String format) { - _format = format; - } + volFormat(String format) { + _format = format; + } - @Override - public String toString() { - return _format; - } + @Override + public String toString() { + return _format; + } - public static volFormat getFormat(String format) { - if (format == null) { - return null; - } - if (format.equalsIgnoreCase("raw")) { - return RAW; - } else if (format.equalsIgnoreCase("qcow2")) { - return QCOW2; - } - return null; - } - } + public static volFormat getFormat(String format) { + if (format == null) { + return null; + } + if (format.equalsIgnoreCase("raw")) { + return RAW; + } else if (format.equalsIgnoreCase("qcow2")) { + return QCOW2; + } + return null; + } + } - private String _volName; - private Long _volSize; - private volFormat _volFormat; - private String _backingPath; - private volFormat _backingFormat; + private String _volName; + private Long _volSize; + private volFormat _volFormat; + private String _backingPath; + private volFormat _backingFormat; - public LibvirtStorageVolumeDef(String volName, Long size, volFormat format, - String tmplPath, volFormat tmplFormat) { - _volName = volName; - _volSize = size; - _volFormat = format; - _backingPath = tmplPath; - _backingFormat = tmplFormat; - } + public LibvirtStorageVolumeDef(String volName, Long size, volFormat format, + String tmplPath, volFormat tmplFormat) { + _volName = volName; + _volSize = size; + _volFormat = format; + _backingPath = tmplPath; + _backingFormat = tmplFormat; + } - public volFormat getFormat() { - return this._volFormat; - } + public volFormat getFormat() { + return this._volFormat; + } - @Override - public String toString() { - StringBuilder storageVolBuilder = new StringBuilder(); - storageVolBuilder.append("\n"); - storageVolBuilder.append("" + _volName + "\n"); - if (_volSize != null) { - storageVolBuilder - .append("" + _volSize + "\n"); - } - storageVolBuilder.append("\n"); - storageVolBuilder.append("\n"); - storageVolBuilder.append(""); - storageVolBuilder.append("0744"); - storageVolBuilder.append(""); - storageVolBuilder.append("\n"); - if (_backingPath != null) { - storageVolBuilder.append("\n"); - storageVolBuilder.append("" + _backingPath + "\n"); - storageVolBuilder.append("\n"); - storageVolBuilder.append("\n"); - } - storageVolBuilder.append("\n"); - return storageVolBuilder.toString(); - } + @Override + public String toString() { + StringBuilder storageVolBuilder = new StringBuilder(); + storageVolBuilder.append("\n"); + storageVolBuilder.append("" + _volName + "\n"); + if (_volSize != null) { + storageVolBuilder + .append("" + _volSize + "\n"); + } + storageVolBuilder.append("\n"); + storageVolBuilder.append("\n"); + storageVolBuilder.append(""); + storageVolBuilder.append("0744"); + storageVolBuilder.append(""); + storageVolBuilder.append("\n"); + if (_backingPath != null) { + storageVolBuilder.append("\n"); + storageVolBuilder.append("" + _backingPath + "\n"); + storageVolBuilder.append("\n"); + storageVolBuilder.append("\n"); + } + storageVolBuilder.append("\n"); + return storageVolBuilder.toString(); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeXMLParser.java b/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeXMLParser.java index c4fe6dffd2f..163ca2b19db 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeXMLParser.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtStorageVolumeXMLParser.java @@ -32,73 +32,73 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; public class LibvirtStorageVolumeXMLParser { - private static final Logger s_logger = Logger - .getLogger(LibvirtStorageVolumeXMLParser.class); + private static final Logger s_logger = Logger + .getLogger(LibvirtStorageVolumeXMLParser.class); - public LibvirtStorageVolumeDef parseStorageVolumeXML(String volXML) { - DocumentBuilder builder; - try { - builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + public LibvirtStorageVolumeDef parseStorageVolumeXML(String volXML) { + DocumentBuilder builder; + try { + builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(volXML)); - Document doc = builder.parse(is); + InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(volXML)); + Document doc = builder.parse(is); - Element rootElement = doc.getDocumentElement(); + Element rootElement = doc.getDocumentElement(); - String VolName = getTagValue("name", rootElement); - Element target = (Element) rootElement.getElementsByTagName( - "target").item(0); - String format = getAttrValue("type", "format", target); - Long capacity = Long - .parseLong(getTagValue("capacity", rootElement)); - return new LibvirtStorageVolumeDef(VolName, capacity, - LibvirtStorageVolumeDef.volFormat.getFormat(format), null, - null); - } catch (ParserConfigurationException e) { - s_logger.debug(e.toString()); - } catch (SAXException e) { - s_logger.debug(e.toString()); - } catch (IOException e) { - s_logger.debug(e.toString()); - } - return null; - } + String VolName = getTagValue("name", rootElement); + Element target = (Element) rootElement.getElementsByTagName( + "target").item(0); + String format = getAttrValue("type", "format", target); + Long capacity = Long + .parseLong(getTagValue("capacity", rootElement)); + return new LibvirtStorageVolumeDef(VolName, capacity, + LibvirtStorageVolumeDef.volFormat.getFormat(format), null, + null); + } catch (ParserConfigurationException e) { + s_logger.debug(e.toString()); + } catch (SAXException e) { + s_logger.debug(e.toString()); + } catch (IOException e) { + s_logger.debug(e.toString()); + } + return null; + } - private static String getTagValue(String tag, Element eElement) { - NodeList nlList = eElement.getElementsByTagName(tag).item(0) - .getChildNodes(); - Node nValue = (Node) nlList.item(0); + private static String getTagValue(String tag, Element eElement) { + NodeList nlList = eElement.getElementsByTagName(tag).item(0) + .getChildNodes(); + Node nValue = (Node) nlList.item(0); - return nValue.getNodeValue(); - } + return nValue.getNodeValue(); + } - private static String getAttrValue(String tag, String attr, Element eElement) { - NodeList tagNode = eElement.getElementsByTagName(tag); - if (tagNode.getLength() == 0) { - return null; - } - Element node = (Element) tagNode.item(0); - return node.getAttribute(attr); - } + private static String getAttrValue(String tag, String attr, Element eElement) { + NodeList tagNode = eElement.getElementsByTagName(tag); + if (tagNode.getLength() == 0) { + return null; + } + Element node = (Element) tagNode.item(0); + return node.getAttribute(attr); + } - public static void main(String[] args) { - s_logger.addAppender(new org.apache.log4j.ConsoleAppender( - new org.apache.log4j.PatternLayout(), "System.out")); - String storagePool = "" + "test" - + "bf723c83-4b95-259c-7089-60776e61a11f" - + "20314165248" - + "1955450880" - + "18358714368" + "" - + "" - + "" - + "" + "" + "" - + "/media" + "" + "0700" - + "0" + "0" + "" - + "" + ""; + public static void main(String[] args) { + s_logger.addAppender(new org.apache.log4j.ConsoleAppender( + new org.apache.log4j.PatternLayout(), "System.out")); + String storagePool = "" + "test" + + "bf723c83-4b95-259c-7089-60776e61a11f" + + "20314165248" + + "1955450880" + + "18358714368" + "" + + "" + + "" + + "" + "" + "" + + "/media" + "" + "0700" + + "0" + "0" + "" + + "" + ""; - LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); - LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(storagePool); - s_logger.debug(pool.toString()); - } + LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); + LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(storagePool); + s_logger.debug(pool.toString()); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtVMDef.java b/agent/src/com/cloud/agent/resource/computing/LibvirtVMDef.java index 0210351c41d..8fd7815bf69 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtVMDef.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtVMDef.java @@ -24,879 +24,879 @@ import java.util.Map; import java.util.UUID; public class LibvirtVMDef { - private String _hvsType; - private String _domName; - private String _domUUID; - private String _desc; - private final Map components = new HashMap(); - - public static class GuestDef { - enum guestType { - KVM, XEN, EXE - } - - enum bootOrder { - HARDISK("hd"), CDROM("cdrom"), FLOOPY("fd"), NETWORK("network"); - String _order; - - bootOrder(String order) { - _order = order; - } - - @Override - public String toString() { - return _order; - } - } - - private guestType _type; - private String _arch; - private String _loader; - private String _kernel; - private String _initrd; - private String _root; - private String _cmdline; - private List _bootdevs = new ArrayList(); - private String _machine; - - public void setGuestType(guestType type) { - _type = type; - } - - public void setGuestArch(String arch) { - _arch = arch; - } - - public void setMachineType(String machine) { - _machine = machine; - } - - public void setLoader(String loader) { - _loader = loader; - } - - public void setBootKernel(String kernel, String initrd, String rootdev, - String cmdline) { - _kernel = kernel; - _initrd = initrd; - _root = rootdev; - _cmdline = cmdline; - } - - public void setBootOrder(bootOrder order) { - _bootdevs.add(order); - } - - @Override - public String toString() { - if (_type == guestType.KVM) { - StringBuilder guestDef = new StringBuilder(); - guestDef.append("\n"); - guestDef.append("hvm\n"); - if (!_bootdevs.isEmpty()) { - for (bootOrder bo : _bootdevs) { - guestDef.append("\n"); - } - } - guestDef.append("\n"); - return guestDef.toString(); - } else - return null; - } - } - - public static class GuestResourceDef { - private long _mem; - private int _currentMem = -1; - private String _memBacking; - private int _vcpu = -1; - - public void setMemorySize(long mem) { - _mem = mem; - } - - public void setCurrentMem(int currMem) { - _currentMem = currMem; - } - - public void setMemBacking(String memBacking) { - _memBacking = memBacking; - } - - public void setVcpuNum(int vcpu) { - _vcpu = vcpu; - } - - @Override - public String toString() { - StringBuilder resBuidler = new StringBuilder(); - resBuidler.append("" + _mem + "\n"); - if (_currentMem != -1) { - resBuidler.append("" + _currentMem - + "\n"); - } - if (_memBacking != null) { - resBuidler.append("" + "<" + _memBacking + "/>" - + "\n"); - } - if (_vcpu != -1) { - resBuidler.append("" + _vcpu + "\n"); - } - return resBuidler.toString(); - } - } - - public static class FeaturesDef { - private final List _features = new ArrayList(); - - public void addFeatures(String feature) { - _features.add(feature); - } - - @Override - public String toString() { - StringBuilder feaBuilder = new StringBuilder(); - feaBuilder.append("\n"); - for (String feature : _features) { - feaBuilder.append("<" + feature + "/>\n"); - } - feaBuilder.append("\n"); - return feaBuilder.toString(); - } - } - - public static class TermPolicy { - private String _reboot; - private String _powerOff; - private String _crash; - - public TermPolicy() { - _reboot = _powerOff = _crash = "destroy"; - } - - public void setRebootPolicy(String rbPolicy) { - _reboot = rbPolicy; - } - - public void setPowerOffPolicy(String poPolicy) { - _powerOff = poPolicy; - } - - public void setCrashPolicy(String crashPolicy) { - _crash = crashPolicy; - } - - @Override - public String toString() { - StringBuilder term = new StringBuilder(); - term.append("" + _reboot + "\n"); - term.append("" + _powerOff + "\n"); - term.append("" + _powerOff + "\n"); - return term.toString(); - } - } - - public static class ClockDef { - public enum ClockOffset { - UTC("utc"), LOCALTIME("localtime"), TIMEZONE("timezone"), VARIABLE( - "variable"); - - private String _offset; - - private ClockOffset(String offset) { - _offset = offset; - } - - @Override - public String toString() { - return _offset; - } - } - - private ClockOffset _offset; - private String _timerName; - private String _tickPolicy; - private String _track; - - public ClockDef() { - _offset = ClockOffset.UTC; - } - - public void setClockOffset(ClockOffset offset) { - _offset = offset; - } - - public void setTimer(String timerName, String tickPolicy, String track) { - _timerName = timerName; - _tickPolicy = tickPolicy; - _track = track; - } - - @Override - public String toString() { - StringBuilder clockBuilder = new StringBuilder(); - clockBuilder.append("\n"); - if (_timerName != null) { - clockBuilder.append("\n"); - clockBuilder.append("\n"); - } - clockBuilder.append("\n"); - return clockBuilder.toString(); - } - } - - public static class DevicesDef { - private String _emulator; - private final Map> devices = new HashMap>(); - - public boolean addDevice(Object device) { - Object dev = devices.get(device.getClass().toString()); - if (dev == null) { - List devs = new ArrayList(); - devs.add(device); - devices.put(device.getClass().toString(), devs); - } else { - List devs = (List) dev; - devs.add(device); - } - return true; - } - - public void setEmulatorPath(String emulator) { - _emulator = emulator; - } - - @Override - public String toString() { - StringBuilder devicesBuilder = new StringBuilder(); - devicesBuilder.append("\n"); - if (_emulator != null) { - devicesBuilder.append("" + _emulator - + "\n"); - } - - for (List devs : devices.values()) { - for (Object dev : devs) { - devicesBuilder.append(dev.toString()); - } - } - devicesBuilder.append("\n"); - return devicesBuilder.toString(); - } - - @SuppressWarnings("unchecked") - public List getDisks() { - return (List) devices.get(DiskDef.class.toString()); - } - - @SuppressWarnings("unchecked") - public List getInterfaces() { - return (List) devices.get(InterfaceDef.class - .toString()); - } - - } - - public static class DiskDef { - enum deviceType { - FLOOPY("floopy"), DISK("disk"), CDROM("cdrom"); - String _type; - - deviceType(String type) { - _type = type; - } - - @Override - public String toString() { - return _type; - } - } - - enum diskType { - FILE("file"), BLOCK("block"), DIRECTROY("dir"); - String _diskType; - - diskType(String type) { - _diskType = type; - } - - @Override - public String toString() { - return _diskType; - } - } - - enum diskBus { - IDE("ide"), SCSI("scsi"), VIRTIO("virtio"), XEN("xen"), USB("usb"), UML( - "uml"), FDC("fdc"); - String _bus; - - diskBus(String bus) { - _bus = bus; - } - - @Override - public String toString() { - return _bus; - } - } - - enum diskFmtType { - RAW("raw"), QCOW2("qcow2"); - String _fmtType; - - diskFmtType(String fmt) { - _fmtType = fmt; - } - - @Override - public String toString() { - return _fmtType; - } - } - - private deviceType _deviceType; /* floppy, disk, cdrom */ - private diskType _diskType; - private String _sourcePath; - private String _diskLabel; - private diskBus _bus; - private diskFmtType _diskFmtType; /* qcow2, raw etc. */ - private boolean _readonly = false; - private boolean _shareable = false; - private boolean _deferAttach = false; - - public void setDeviceType(deviceType deviceType) { - _deviceType = deviceType; - } - - public void defFileBasedDisk(String filePath, String diskLabel, - diskBus bus, diskFmtType diskFmtType) { - _diskType = diskType.FILE; - _deviceType = deviceType.DISK; - _sourcePath = filePath; - _diskLabel = diskLabel; - _diskFmtType = diskFmtType; - _bus = bus; - - } - - /* skip iso label */ - private String getDevLabel(int devId, diskBus bus) { - if (devId == 2) { - devId++; - } - - char suffix = (char) ('a' + devId); - if (bus == diskBus.SCSI) { - return "sd" + suffix; - } else if (bus == diskBus.VIRTIO) { - return "vd" + suffix; - } - return "hd" + suffix; - - } - - public void defFileBasedDisk(String filePath, int devId, diskBus bus, - diskFmtType diskFmtType) { - - _diskType = diskType.FILE; - _deviceType = deviceType.DISK; - _sourcePath = filePath; - _diskLabel = getDevLabel(devId, bus); - _diskFmtType = diskFmtType; - _bus = bus; - - } - - public void defISODisk(String volPath) { - _diskType = diskType.FILE; - _deviceType = deviceType.CDROM; - _sourcePath = volPath; - _diskLabel = "hdc"; - _diskFmtType = diskFmtType.RAW; - _bus = diskBus.IDE; - } - - public void defBlockBasedDisk(String diskName, int devId, diskBus bus) { - _diskType = diskType.BLOCK; - _deviceType = deviceType.DISK; - _diskFmtType = diskFmtType.RAW; - _sourcePath = diskName; - _diskLabel = getDevLabel(devId, bus); - _bus = bus; - } - - public void defBlockBasedDisk(String diskName, String diskLabel, - diskBus bus) { - _diskType = diskType.BLOCK; - _deviceType = deviceType.DISK; - _diskFmtType = diskFmtType.RAW; - _sourcePath = diskName; - _diskLabel = diskLabel; - _bus = bus; - } - - public void setReadonly() { - _readonly = true; - } - - public void setSharable() { - _shareable = true; - } - - public void setAttachDeferred(boolean deferAttach) { - _deferAttach = deferAttach; - } - - public boolean isAttachDeferred() { - return _deferAttach; - } - - public String getDiskPath() { - return _sourcePath; - } - - public String getDiskLabel() { - return _diskLabel; - } - - public deviceType getDeviceType() { - return _deviceType; - } - - public void setDiskPath(String volPath) { - this._sourcePath = volPath; - } - - public diskBus getBusType() { - return _bus; - } - - public int getDiskSeq() { - char suffix = this._diskLabel.charAt(this._diskLabel.length() - 1); - return suffix - 'a'; - } - - @Override - public String toString() { - StringBuilder diskBuilder = new StringBuilder(); - diskBuilder.append("\n"); - diskBuilder.append("\n"); - if (_diskType == diskType.FILE) { - diskBuilder.append("\n"); - } else if (_diskType == diskType.BLOCK) { - diskBuilder.append("\n"); - } - diskBuilder.append("\n"); - diskBuilder.append("\n"); - return diskBuilder.toString(); - } - } - - public static class InterfaceDef { - enum guestNetType { - BRIDGE("bridge"), NETWORK("network"), USER("user"), ETHERNET( - "ethernet"), INTERNAL("internal"); - String _type; - - guestNetType(String type) { - _type = type; - } - - @Override - public String toString() { - return _type; - } - } - - enum nicModel { - E1000("e1000"), VIRTIO("virtio"), RTL8139("rtl8139"), NE2KPCI( - "ne2k_pci"); - String _model; - - nicModel(String model) { - _model = model; - } - - @Override - public String toString() { - return _model; - } - } - - enum hostNicType { - DIRECT_ATTACHED_WITHOUT_DHCP, DIRECT_ATTACHED_WITH_DHCP, VNET, VLAN; - } - - private guestNetType _netType; /* - * bridge, ethernet, network, user, - * internal - */ - private hostNicType _hostNetType; /* Only used by agent java code */ - private String _sourceName; - private String _networkName; - private String _macAddr; - private String _ipAddr; - private String _scriptPath; - private nicModel _model; - - public void defBridgeNet(String brName, String targetBrName, - String macAddr, nicModel model) { - _netType = guestNetType.BRIDGE; - _sourceName = brName; - _networkName = targetBrName; - _macAddr = macAddr; - _model = model; - } - - public void defPrivateNet(String networkName, String targetName, - String macAddr, nicModel model) { - _netType = guestNetType.NETWORK; - _sourceName = networkName; - _networkName = targetName; - _macAddr = macAddr; - _model = model; - } - - public void setHostNetType(hostNicType hostNetType) { - _hostNetType = hostNetType; - } - - public hostNicType getHostNetType() { - return _hostNetType; - } - - public String getBrName() { - return _sourceName; - } - - public guestNetType getNetType() { - return _netType; - } - - public String getDevName() { - return _networkName; - } - - public String getMacAddress() { - return _macAddr; - } - - @Override - public String toString() { - StringBuilder netBuilder = new StringBuilder(); - netBuilder.append("\n"); - if (_netType == guestNetType.BRIDGE) { - netBuilder.append("\n"); - } else if (_netType == guestNetType.NETWORK) { - netBuilder.append("\n"); - } - if (_networkName != null) { - netBuilder.append("\n"); - } - if (_macAddr != null) { - netBuilder.append("\n"); - } - if (_model != null) { - netBuilder.append("\n"); - } - netBuilder.append("\n"); - return netBuilder.toString(); - } - } - - public static class ConsoleDef { - private final String _ttyPath; - private final String _type; - private final String _source; - private short _port = -1; - - public ConsoleDef(String type, String path, String source, short port) { - _type = type; - _ttyPath = path; - _source = source; - _port = port; - } - - @Override - public String toString() { - StringBuilder consoleBuilder = new StringBuilder(); - consoleBuilder.append("\n"); - if (_source != null) { - consoleBuilder.append("\n"); - } - if (_port != -1) { - consoleBuilder.append("\n"); - } - consoleBuilder.append("\n"); - return consoleBuilder.toString(); - } - } - - public static class SerialDef { - private final String _type; - private final String _source; - private short _port = -1; - - public SerialDef(String type, String source, short port) { - _type = type; - _source = source; - _port = port; - } - - @Override - public String toString() { - StringBuilder serialBuidler = new StringBuilder(); - serialBuidler.append("\n"); - if (_source != null) { - serialBuidler.append("\n"); - } - if (_port != -1) { - serialBuidler.append("\n"); - } - serialBuidler.append("\n"); - return serialBuidler.toString(); - } - } - - public static class GraphicDef { - private final String _type; - private short _port = -2; - private boolean _autoPort = false; - private final String _listenAddr; - private final String _passwd; - private final String _keyMap; - - public GraphicDef(String type, short port, boolean auotPort, - String listenAddr, String passwd, String keyMap) { - _type = type; - _port = port; - _autoPort = auotPort; - _listenAddr = listenAddr; - _passwd = passwd; - _keyMap = keyMap; - } - - @Override - public String toString() { - StringBuilder graphicBuilder = new StringBuilder(); - graphicBuilder.append("\n"); - return graphicBuilder.toString(); - } - } - - public static class InputDef { - private final String _type; /* tablet, mouse */ - private final String _bus; /* ps2, usb, xen */ - - public InputDef(String type, String bus) { - _type = type; - _bus = bus; - } - - @Override - public String toString() { - StringBuilder inputBuilder = new StringBuilder(); - inputBuilder.append("\n"); - return inputBuilder.toString(); - } - } - - public void setHvsType(String hvs) { - _hvsType = hvs; - } - - public void setDomainName(String domainName) { - _domName = domainName; - } - - public void setDomUUID(String uuid) { - _domUUID = uuid; - } - - public void setDomDescription(String desc) { - _desc = desc; - } - - public String getGuestOSType() { - return _desc; - } - - public void addComp(Object comp) { - components.put(comp.getClass().toString(), comp); - } - - public DevicesDef getDevices() { - Object o = components.get(DevicesDef.class.toString()); - if (o != null) { - return (DevicesDef) o; - } - return null; - } - - @Override - public String toString() { - StringBuilder vmBuilder = new StringBuilder(); - vmBuilder.append("\n"); - vmBuilder.append("" + _domName + "\n"); - if (_domUUID != null) { - vmBuilder.append("" + _domUUID + "\n"); - } - if (_desc != null) { - vmBuilder.append("" + _desc + "\n"); - } - for (Object o : components.values()) { - vmBuilder.append(o.toString()); - } - vmBuilder.append("\n"); - return vmBuilder.toString(); - } - - public static void main(String[] args) { - System.out.println("testing"); - LibvirtVMDef vm = new LibvirtVMDef(); - vm.setHvsType("kvm"); - vm.setDomainName("testing"); - vm.setDomUUID(UUID.randomUUID().toString()); - - GuestDef guest = new GuestDef(); - guest.setGuestType(GuestDef.guestType.KVM); - guest.setGuestArch("x86_64"); - guest.setMachineType("pc-0.11"); - guest.setBootOrder(GuestDef.bootOrder.HARDISK); - vm.addComp(guest); - - GuestResourceDef grd = new GuestResourceDef(); - grd.setMemorySize(512 * 1024); - grd.setVcpuNum(1); - vm.addComp(grd); - - FeaturesDef features = new FeaturesDef(); - features.addFeatures("pae"); - features.addFeatures("apic"); - features.addFeatures("acpi"); - vm.addComp(features); - - TermPolicy term = new TermPolicy(); - term.setCrashPolicy("destroy"); - term.setPowerOffPolicy("destroy"); - term.setRebootPolicy("destroy"); - vm.addComp(term); - - DevicesDef devices = new DevicesDef(); - devices.setEmulatorPath("/usr/bin/cloud-qemu-system-x86_64"); - - DiskDef hda = new DiskDef(); - hda.defFileBasedDisk("/path/to/hda1", 0, DiskDef.diskBus.VIRTIO, - DiskDef.diskFmtType.QCOW2); - devices.addDevice(hda); - - DiskDef hdb = new DiskDef(); - hdb.defFileBasedDisk("/path/to/hda2", 1, DiskDef.diskBus.VIRTIO, - DiskDef.diskFmtType.QCOW2); - devices.addDevice(hdb); - - InterfaceDef pubNic = new InterfaceDef(); - pubNic.defBridgeNet("cloudbr0", "vnet1", "00:16:3e:77:e2:a1", - InterfaceDef.nicModel.VIRTIO); - devices.addDevice(pubNic); - - InterfaceDef privNic = new InterfaceDef(); - privNic.defPrivateNet("cloud-private", null, "00:16:3e:77:e2:a2", - InterfaceDef.nicModel.VIRTIO); - devices.addDevice(privNic); - - InterfaceDef vlanNic = new InterfaceDef(); - vlanNic.defBridgeNet("vnbr1000", "tap1", "00:16:3e:77:e2:a2", - InterfaceDef.nicModel.VIRTIO); - devices.addDevice(vlanNic); - - SerialDef serial = new SerialDef("pty", null, (short) 0); - devices.addDevice(serial); - - ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0); - devices.addDevice(console); - - GraphicDef grap = new GraphicDef("vnc", (short) 0, true, null, null, - null); - devices.addDevice(grap); - - InputDef input = new InputDef("tablet", "usb"); - devices.addDevice(input); - - vm.addComp(devices); - - System.out.println(vm.toString()); - } + private String _hvsType; + private String _domName; + private String _domUUID; + private String _desc; + private final Map components = new HashMap(); + + public static class GuestDef { + enum guestType { + KVM, XEN, EXE + } + + enum bootOrder { + HARDISK("hd"), CDROM("cdrom"), FLOOPY("fd"), NETWORK("network"); + String _order; + + bootOrder(String order) { + _order = order; + } + + @Override + public String toString() { + return _order; + } + } + + private guestType _type; + private String _arch; + private String _loader; + private String _kernel; + private String _initrd; + private String _root; + private String _cmdline; + private List _bootdevs = new ArrayList(); + private String _machine; + + public void setGuestType(guestType type) { + _type = type; + } + + public void setGuestArch(String arch) { + _arch = arch; + } + + public void setMachineType(String machine) { + _machine = machine; + } + + public void setLoader(String loader) { + _loader = loader; + } + + public void setBootKernel(String kernel, String initrd, String rootdev, + String cmdline) { + _kernel = kernel; + _initrd = initrd; + _root = rootdev; + _cmdline = cmdline; + } + + public void setBootOrder(bootOrder order) { + _bootdevs.add(order); + } + + @Override + public String toString() { + if (_type == guestType.KVM) { + StringBuilder guestDef = new StringBuilder(); + guestDef.append("\n"); + guestDef.append("hvm\n"); + if (!_bootdevs.isEmpty()) { + for (bootOrder bo : _bootdevs) { + guestDef.append("\n"); + } + } + guestDef.append("\n"); + return guestDef.toString(); + } else + return null; + } + } + + public static class GuestResourceDef { + private long _mem; + private int _currentMem = -1; + private String _memBacking; + private int _vcpu = -1; + + public void setMemorySize(long mem) { + _mem = mem; + } + + public void setCurrentMem(int currMem) { + _currentMem = currMem; + } + + public void setMemBacking(String memBacking) { + _memBacking = memBacking; + } + + public void setVcpuNum(int vcpu) { + _vcpu = vcpu; + } + + @Override + public String toString() { + StringBuilder resBuidler = new StringBuilder(); + resBuidler.append("" + _mem + "\n"); + if (_currentMem != -1) { + resBuidler.append("" + _currentMem + + "\n"); + } + if (_memBacking != null) { + resBuidler.append("" + "<" + _memBacking + "/>" + + "\n"); + } + if (_vcpu != -1) { + resBuidler.append("" + _vcpu + "\n"); + } + return resBuidler.toString(); + } + } + + public static class FeaturesDef { + private final List _features = new ArrayList(); + + public void addFeatures(String feature) { + _features.add(feature); + } + + @Override + public String toString() { + StringBuilder feaBuilder = new StringBuilder(); + feaBuilder.append("\n"); + for (String feature : _features) { + feaBuilder.append("<" + feature + "/>\n"); + } + feaBuilder.append("\n"); + return feaBuilder.toString(); + } + } + + public static class TermPolicy { + private String _reboot; + private String _powerOff; + private String _crash; + + public TermPolicy() { + _reboot = _powerOff = _crash = "destroy"; + } + + public void setRebootPolicy(String rbPolicy) { + _reboot = rbPolicy; + } + + public void setPowerOffPolicy(String poPolicy) { + _powerOff = poPolicy; + } + + public void setCrashPolicy(String crashPolicy) { + _crash = crashPolicy; + } + + @Override + public String toString() { + StringBuilder term = new StringBuilder(); + term.append("" + _reboot + "\n"); + term.append("" + _powerOff + "\n"); + term.append("" + _powerOff + "\n"); + return term.toString(); + } + } + + public static class ClockDef { + public enum ClockOffset { + UTC("utc"), LOCALTIME("localtime"), TIMEZONE("timezone"), VARIABLE( + "variable"); + + private String _offset; + + private ClockOffset(String offset) { + _offset = offset; + } + + @Override + public String toString() { + return _offset; + } + } + + private ClockOffset _offset; + private String _timerName; + private String _tickPolicy; + private String _track; + + public ClockDef() { + _offset = ClockOffset.UTC; + } + + public void setClockOffset(ClockOffset offset) { + _offset = offset; + } + + public void setTimer(String timerName, String tickPolicy, String track) { + _timerName = timerName; + _tickPolicy = tickPolicy; + _track = track; + } + + @Override + public String toString() { + StringBuilder clockBuilder = new StringBuilder(); + clockBuilder.append("\n"); + if (_timerName != null) { + clockBuilder.append("\n"); + clockBuilder.append("\n"); + } + clockBuilder.append("\n"); + return clockBuilder.toString(); + } + } + + public static class DevicesDef { + private String _emulator; + private final Map> devices = new HashMap>(); + + public boolean addDevice(Object device) { + Object dev = devices.get(device.getClass().toString()); + if (dev == null) { + List devs = new ArrayList(); + devs.add(device); + devices.put(device.getClass().toString(), devs); + } else { + List devs = (List) dev; + devs.add(device); + } + return true; + } + + public void setEmulatorPath(String emulator) { + _emulator = emulator; + } + + @Override + public String toString() { + StringBuilder devicesBuilder = new StringBuilder(); + devicesBuilder.append("\n"); + if (_emulator != null) { + devicesBuilder.append("" + _emulator + + "\n"); + } + + for (List devs : devices.values()) { + for (Object dev : devs) { + devicesBuilder.append(dev.toString()); + } + } + devicesBuilder.append("\n"); + return devicesBuilder.toString(); + } + + @SuppressWarnings("unchecked") + public List getDisks() { + return (List) devices.get(DiskDef.class.toString()); + } + + @SuppressWarnings("unchecked") + public List getInterfaces() { + return (List) devices.get(InterfaceDef.class + .toString()); + } + + } + + public static class DiskDef { + enum deviceType { + FLOOPY("floopy"), DISK("disk"), CDROM("cdrom"); + String _type; + + deviceType(String type) { + _type = type; + } + + @Override + public String toString() { + return _type; + } + } + + enum diskType { + FILE("file"), BLOCK("block"), DIRECTROY("dir"); + String _diskType; + + diskType(String type) { + _diskType = type; + } + + @Override + public String toString() { + return _diskType; + } + } + + enum diskBus { + IDE("ide"), SCSI("scsi"), VIRTIO("virtio"), XEN("xen"), USB("usb"), UML( + "uml"), FDC("fdc"); + String _bus; + + diskBus(String bus) { + _bus = bus; + } + + @Override + public String toString() { + return _bus; + } + } + + enum diskFmtType { + RAW("raw"), QCOW2("qcow2"); + String _fmtType; + + diskFmtType(String fmt) { + _fmtType = fmt; + } + + @Override + public String toString() { + return _fmtType; + } + } + + private deviceType _deviceType; /* floppy, disk, cdrom */ + private diskType _diskType; + private String _sourcePath; + private String _diskLabel; + private diskBus _bus; + private diskFmtType _diskFmtType; /* qcow2, raw etc. */ + private boolean _readonly = false; + private boolean _shareable = false; + private boolean _deferAttach = false; + + public void setDeviceType(deviceType deviceType) { + _deviceType = deviceType; + } + + public void defFileBasedDisk(String filePath, String diskLabel, + diskBus bus, diskFmtType diskFmtType) { + _diskType = diskType.FILE; + _deviceType = deviceType.DISK; + _sourcePath = filePath; + _diskLabel = diskLabel; + _diskFmtType = diskFmtType; + _bus = bus; + + } + + /* skip iso label */ + private String getDevLabel(int devId, diskBus bus) { + if (devId == 2) { + devId++; + } + + char suffix = (char) ('a' + devId); + if (bus == diskBus.SCSI) { + return "sd" + suffix; + } else if (bus == diskBus.VIRTIO) { + return "vd" + suffix; + } + return "hd" + suffix; + + } + + public void defFileBasedDisk(String filePath, int devId, diskBus bus, + diskFmtType diskFmtType) { + + _diskType = diskType.FILE; + _deviceType = deviceType.DISK; + _sourcePath = filePath; + _diskLabel = getDevLabel(devId, bus); + _diskFmtType = diskFmtType; + _bus = bus; + + } + + public void defISODisk(String volPath) { + _diskType = diskType.FILE; + _deviceType = deviceType.CDROM; + _sourcePath = volPath; + _diskLabel = "hdc"; + _diskFmtType = diskFmtType.RAW; + _bus = diskBus.IDE; + } + + public void defBlockBasedDisk(String diskName, int devId, diskBus bus) { + _diskType = diskType.BLOCK; + _deviceType = deviceType.DISK; + _diskFmtType = diskFmtType.RAW; + _sourcePath = diskName; + _diskLabel = getDevLabel(devId, bus); + _bus = bus; + } + + public void defBlockBasedDisk(String diskName, String diskLabel, + diskBus bus) { + _diskType = diskType.BLOCK; + _deviceType = deviceType.DISK; + _diskFmtType = diskFmtType.RAW; + _sourcePath = diskName; + _diskLabel = diskLabel; + _bus = bus; + } + + public void setReadonly() { + _readonly = true; + } + + public void setSharable() { + _shareable = true; + } + + public void setAttachDeferred(boolean deferAttach) { + _deferAttach = deferAttach; + } + + public boolean isAttachDeferred() { + return _deferAttach; + } + + public String getDiskPath() { + return _sourcePath; + } + + public String getDiskLabel() { + return _diskLabel; + } + + public deviceType getDeviceType() { + return _deviceType; + } + + public void setDiskPath(String volPath) { + this._sourcePath = volPath; + } + + public diskBus getBusType() { + return _bus; + } + + public int getDiskSeq() { + char suffix = this._diskLabel.charAt(this._diskLabel.length() - 1); + return suffix - 'a'; + } + + @Override + public String toString() { + StringBuilder diskBuilder = new StringBuilder(); + diskBuilder.append("\n"); + diskBuilder.append("\n"); + if (_diskType == diskType.FILE) { + diskBuilder.append("\n"); + } else if (_diskType == diskType.BLOCK) { + diskBuilder.append("\n"); + } + diskBuilder.append("\n"); + diskBuilder.append("\n"); + return diskBuilder.toString(); + } + } + + public static class InterfaceDef { + enum guestNetType { + BRIDGE("bridge"), NETWORK("network"), USER("user"), ETHERNET( + "ethernet"), INTERNAL("internal"); + String _type; + + guestNetType(String type) { + _type = type; + } + + @Override + public String toString() { + return _type; + } + } + + enum nicModel { + E1000("e1000"), VIRTIO("virtio"), RTL8139("rtl8139"), NE2KPCI( + "ne2k_pci"); + String _model; + + nicModel(String model) { + _model = model; + } + + @Override + public String toString() { + return _model; + } + } + + enum hostNicType { + DIRECT_ATTACHED_WITHOUT_DHCP, DIRECT_ATTACHED_WITH_DHCP, VNET, VLAN; + } + + private guestNetType _netType; /* + * bridge, ethernet, network, user, + * internal + */ + private hostNicType _hostNetType; /* Only used by agent java code */ + private String _sourceName; + private String _networkName; + private String _macAddr; + private String _ipAddr; + private String _scriptPath; + private nicModel _model; + + public void defBridgeNet(String brName, String targetBrName, + String macAddr, nicModel model) { + _netType = guestNetType.BRIDGE; + _sourceName = brName; + _networkName = targetBrName; + _macAddr = macAddr; + _model = model; + } + + public void defPrivateNet(String networkName, String targetName, + String macAddr, nicModel model) { + _netType = guestNetType.NETWORK; + _sourceName = networkName; + _networkName = targetName; + _macAddr = macAddr; + _model = model; + } + + public void setHostNetType(hostNicType hostNetType) { + _hostNetType = hostNetType; + } + + public hostNicType getHostNetType() { + return _hostNetType; + } + + public String getBrName() { + return _sourceName; + } + + public guestNetType getNetType() { + return _netType; + } + + public String getDevName() { + return _networkName; + } + + public String getMacAddress() { + return _macAddr; + } + + @Override + public String toString() { + StringBuilder netBuilder = new StringBuilder(); + netBuilder.append("\n"); + if (_netType == guestNetType.BRIDGE) { + netBuilder.append("\n"); + } else if (_netType == guestNetType.NETWORK) { + netBuilder.append("\n"); + } + if (_networkName != null) { + netBuilder.append("\n"); + } + if (_macAddr != null) { + netBuilder.append("\n"); + } + if (_model != null) { + netBuilder.append("\n"); + } + netBuilder.append("\n"); + return netBuilder.toString(); + } + } + + public static class ConsoleDef { + private final String _ttyPath; + private final String _type; + private final String _source; + private short _port = -1; + + public ConsoleDef(String type, String path, String source, short port) { + _type = type; + _ttyPath = path; + _source = source; + _port = port; + } + + @Override + public String toString() { + StringBuilder consoleBuilder = new StringBuilder(); + consoleBuilder.append("\n"); + if (_source != null) { + consoleBuilder.append("\n"); + } + if (_port != -1) { + consoleBuilder.append("\n"); + } + consoleBuilder.append("\n"); + return consoleBuilder.toString(); + } + } + + public static class SerialDef { + private final String _type; + private final String _source; + private short _port = -1; + + public SerialDef(String type, String source, short port) { + _type = type; + _source = source; + _port = port; + } + + @Override + public String toString() { + StringBuilder serialBuidler = new StringBuilder(); + serialBuidler.append("\n"); + if (_source != null) { + serialBuidler.append("\n"); + } + if (_port != -1) { + serialBuidler.append("\n"); + } + serialBuidler.append("\n"); + return serialBuidler.toString(); + } + } + + public static class GraphicDef { + private final String _type; + private short _port = -2; + private boolean _autoPort = false; + private final String _listenAddr; + private final String _passwd; + private final String _keyMap; + + public GraphicDef(String type, short port, boolean autoPort, + String listenAddr, String passwd, String keyMap) { + _type = type; + _port = port; + _autoPort = autoPort; + _listenAddr = listenAddr; + _passwd = passwd; + _keyMap = keyMap; + } + + @Override + public String toString() { + StringBuilder graphicBuilder = new StringBuilder(); + graphicBuilder.append("\n"); + return graphicBuilder.toString(); + } + } + + public static class InputDef { + private final String _type; /* tablet, mouse */ + private final String _bus; /* ps2, usb, xen */ + + public InputDef(String type, String bus) { + _type = type; + _bus = bus; + } + + @Override + public String toString() { + StringBuilder inputBuilder = new StringBuilder(); + inputBuilder.append("\n"); + return inputBuilder.toString(); + } + } + + public void setHvsType(String hvs) { + _hvsType = hvs; + } + + public void setDomainName(String domainName) { + _domName = domainName; + } + + public void setDomUUID(String uuid) { + _domUUID = uuid; + } + + public void setDomDescription(String desc) { + _desc = desc; + } + + public String getGuestOSType() { + return _desc; + } + + public void addComp(Object comp) { + components.put(comp.getClass().toString(), comp); + } + + public DevicesDef getDevices() { + Object o = components.get(DevicesDef.class.toString()); + if (o != null) { + return (DevicesDef) o; + } + return null; + } + + @Override + public String toString() { + StringBuilder vmBuilder = new StringBuilder(); + vmBuilder.append("\n"); + vmBuilder.append("" + _domName + "\n"); + if (_domUUID != null) { + vmBuilder.append("" + _domUUID + "\n"); + } + if (_desc != null) { + vmBuilder.append("" + _desc + "\n"); + } + for (Object o : components.values()) { + vmBuilder.append(o.toString()); + } + vmBuilder.append("\n"); + return vmBuilder.toString(); + } + + public static void main(String[] args) { + System.out.println("testing"); + LibvirtVMDef vm = new LibvirtVMDef(); + vm.setHvsType("kvm"); + vm.setDomainName("testing"); + vm.setDomUUID(UUID.randomUUID().toString()); + + GuestDef guest = new GuestDef(); + guest.setGuestType(GuestDef.guestType.KVM); + guest.setGuestArch("x86_64"); + guest.setMachineType("pc-0.11"); + guest.setBootOrder(GuestDef.bootOrder.HARDISK); + vm.addComp(guest); + + GuestResourceDef grd = new GuestResourceDef(); + grd.setMemorySize(512 * 1024); + grd.setVcpuNum(1); + vm.addComp(grd); + + FeaturesDef features = new FeaturesDef(); + features.addFeatures("pae"); + features.addFeatures("apic"); + features.addFeatures("acpi"); + vm.addComp(features); + + TermPolicy term = new TermPolicy(); + term.setCrashPolicy("destroy"); + term.setPowerOffPolicy("destroy"); + term.setRebootPolicy("destroy"); + vm.addComp(term); + + DevicesDef devices = new DevicesDef(); + devices.setEmulatorPath("/usr/bin/cloud-qemu-system-x86_64"); + + DiskDef hda = new DiskDef(); + hda.defFileBasedDisk("/path/to/hda1", 0, DiskDef.diskBus.VIRTIO, + DiskDef.diskFmtType.QCOW2); + devices.addDevice(hda); + + DiskDef hdb = new DiskDef(); + hdb.defFileBasedDisk("/path/to/hda2", 1, DiskDef.diskBus.VIRTIO, + DiskDef.diskFmtType.QCOW2); + devices.addDevice(hdb); + + InterfaceDef pubNic = new InterfaceDef(); + pubNic.defBridgeNet("cloudbr0", "vnet1", "00:16:3e:77:e2:a1", + InterfaceDef.nicModel.VIRTIO); + devices.addDevice(pubNic); + + InterfaceDef privNic = new InterfaceDef(); + privNic.defPrivateNet("cloud-private", null, "00:16:3e:77:e2:a2", + InterfaceDef.nicModel.VIRTIO); + devices.addDevice(privNic); + + InterfaceDef vlanNic = new InterfaceDef(); + vlanNic.defBridgeNet("vnbr1000", "tap1", "00:16:3e:77:e2:a2", + InterfaceDef.nicModel.VIRTIO); + devices.addDevice(vlanNic); + + SerialDef serial = new SerialDef("pty", null, (short) 0); + devices.addDevice(serial); + + ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0); + devices.addDevice(console); + + GraphicDef grap = new GraphicDef("vnc", (short) 0, true, null, null, + null); + devices.addDevice(grap); + + InputDef input = new InputDef("tablet", "usb"); + devices.addDevice(input); + + vm.addComp(devices); + + System.out.println(vm.toString()); + } } diff --git a/agent/src/com/cloud/agent/resource/computing/LibvirtXMLParser.java b/agent/src/com/cloud/agent/resource/computing/LibvirtXMLParser.java index 641e7f67eb7..b73ea0f0c3f 100644 --- a/agent/src/com/cloud/agent/resource/computing/LibvirtXMLParser.java +++ b/agent/src/com/cloud/agent/resource/computing/LibvirtXMLParser.java @@ -28,45 +28,45 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class LibvirtXMLParser extends DefaultHandler { - private static final Logger s_logger = Logger - .getLogger(LibvirtXMLParser.class); - protected static SAXParserFactory s_spf; + private static final Logger s_logger = Logger + .getLogger(LibvirtXMLParser.class); + protected static SAXParserFactory s_spf; - static { - s_spf = SAXParserFactory.newInstance(); + static { + s_spf = SAXParserFactory.newInstance(); - } - protected SAXParser _sp; - protected boolean _initialized = false; + } + protected SAXParser _sp; + protected boolean _initialized = false; - public LibvirtXMLParser() { + public LibvirtXMLParser() { - try { - _sp = s_spf.newSAXParser(); - _initialized = true; - } catch (Exception ex) { - } + try { + _sp = s_spf.newSAXParser(); + _initialized = true; + } catch (Exception ex) { + } - } + } - public boolean parseDomainXML(String domXML) { - if (!_initialized) { - return false; - } - try { - _sp.parse(new InputSource(new StringReader(domXML)), this); - return true; - } catch (SAXException se) { - s_logger.warn(se.getMessage()); - } catch (IOException ie) { - s_logger.error(ie.getMessage()); - } - return false; - } + public boolean parseDomainXML(String domXML) { + if (!_initialized) { + return false; + } + try { + _sp.parse(new InputSource(new StringReader(domXML)), this); + return true; + } catch (SAXException se) { + s_logger.warn(se.getMessage()); + } catch (IOException ie) { + s_logger.error(ie.getMessage()); + } + return false; + } - @Override - public void characters(char[] ch, int start, int length) - throws SAXException { - } + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + } } diff --git a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java index db2424f3347..6ed211a2d2f 100644 --- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java +++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java @@ -17,64 +17,64 @@ package com.cloud.agent.resource.consoleproxy; public class ConsoleProxyAuthenticationResult { - private boolean success; - private boolean isReauthentication; - private String host; - private int port; - private String tunnelUrl; - private String tunnelSession; - - public ConsoleProxyAuthenticationResult() { - success = false; - isReauthentication = false; - port = 0; - } + private boolean success; + private boolean isReauthentication; + private String host; + private int port; + private String tunnelUrl; + private String tunnelSession; + + public ConsoleProxyAuthenticationResult() { + success = false; + isReauthentication = false; + port = 0; + } - public boolean isSuccess() { - return success; - } + public boolean isSuccess() { + return success; + } - public void setSuccess(boolean success) { - this.success = success; - } + public void setSuccess(boolean success) { + this.success = success; + } - public boolean isReauthentication() { - return isReauthentication; - } + public boolean isReauthentication() { + return isReauthentication; + } - public void setReauthentication(boolean isReauthentication) { - this.isReauthentication = isReauthentication; - } + public void setReauthentication(boolean isReauthentication) { + this.isReauthentication = isReauthentication; + } - public String getHost() { - return host; - } + public String getHost() { + return host; + } - public void setHost(String host) { - this.host = host; - } + public void setHost(String host) { + this.host = host; + } - public int getPort() { - return port; - } + public int getPort() { + return port; + } - public void setPort(int port) { - this.port = port; - } + public void setPort(int port) { + this.port = port; + } - public String getTunnelUrl() { - return tunnelUrl; - } + public String getTunnelUrl() { + return tunnelUrl; + } - public void setTunnelUrl(String tunnelUrl) { - this.tunnelUrl = tunnelUrl; - } + public void setTunnelUrl(String tunnelUrl) { + this.tunnelUrl = tunnelUrl; + } - public String getTunnelSession() { - return tunnelSession; - } + public String getTunnelSession() { + return tunnelSession; + } - public void setTunnelSession(String tunnelSession) { - this.tunnelSession = tunnelSession; - } + public void setTunnelSession(String tunnelSession) { + this.tunnelSession = tunnelSession; + } } diff --git a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java index 575dcf1e5a6..48f507900d6 100644 --- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java +++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java @@ -78,415 +78,415 @@ import com.google.gson.Gson; * */ public class ConsoleProxyResource extends ServerResourceBase implements - ServerResource { - static final Logger s_logger = Logger.getLogger(ConsoleProxyResource.class); + ServerResource { + static final Logger s_logger = Logger.getLogger(ConsoleProxyResource.class); - private final Properties _properties = new Properties(); - private Thread _consoleProxyMain = null; + private final Properties _properties = new Properties(); + private Thread _consoleProxyMain = null; - long _proxyVmId; - int _proxyPort; + long _proxyVmId; + int _proxyPort; - String _localgw; - String _eth1ip; - String _eth1mask; - String _pubIp; + String _localgw; + String _eth1ip; + String _eth1mask; + String _pubIp; - @Override - public Answer executeRequest(final Command cmd) { - if (cmd instanceof CheckConsoleProxyLoadCommand) { - return execute((CheckConsoleProxyLoadCommand) cmd); - } else if (cmd instanceof WatchConsoleProxyLoadCommand) { - return execute((WatchConsoleProxyLoadCommand) cmd); - } else if (cmd instanceof ReadyCommand) { - s_logger.info("Receive ReadyCommand, response with ReadyAnswer"); - return new ReadyAnswer((ReadyCommand) cmd); - } else if (cmd instanceof CheckHealthCommand) { - return new CheckHealthAnswer((CheckHealthCommand) cmd, true); - } else if (cmd instanceof StartConsoleProxyAgentHttpHandlerCommand) { - return execute((StartConsoleProxyAgentHttpHandlerCommand) cmd); - } else { - return Answer.createUnsupportedCommandAnswer(cmd); - } - } + @Override + public Answer executeRequest(final Command cmd) { + if (cmd instanceof CheckConsoleProxyLoadCommand) { + return execute((CheckConsoleProxyLoadCommand) cmd); + } else if (cmd instanceof WatchConsoleProxyLoadCommand) { + return execute((WatchConsoleProxyLoadCommand) cmd); + } else if (cmd instanceof ReadyCommand) { + s_logger.info("Receive ReadyCommand, response with ReadyAnswer"); + return new ReadyAnswer((ReadyCommand) cmd); + } else if (cmd instanceof CheckHealthCommand) { + return new CheckHealthAnswer((CheckHealthCommand) cmd, true); + } else if (cmd instanceof StartConsoleProxyAgentHttpHandlerCommand) { + return execute((StartConsoleProxyAgentHttpHandlerCommand) cmd); + } else { + return Answer.createUnsupportedCommandAnswer(cmd); + } + } - private Answer execute(StartConsoleProxyAgentHttpHandlerCommand cmd) { - launchConsoleProxy(cmd.getKeystoreBits(), cmd.getKeystorePassword(), cmd.getEncryptorPassword()); - return new Answer(cmd); - } + private Answer execute(StartConsoleProxyAgentHttpHandlerCommand cmd) { + launchConsoleProxy(cmd.getKeystoreBits(), cmd.getKeystorePassword(), cmd.getEncryptorPassword()); + return new Answer(cmd); + } - private void disableRpFilter() { - try { - FileWriter fstream = new FileWriter( - "/proc/sys/net/ipv4/conf/eth2/rp_filter"); - BufferedWriter out = new BufferedWriter(fstream); - out.write("0"); - out.close(); - } catch (IOException e) { - s_logger.warn("Unable to disable rp_filter"); - } - } + private void disableRpFilter() { + try { + FileWriter fstream = new FileWriter( + "/proc/sys/net/ipv4/conf/eth2/rp_filter"); + BufferedWriter out = new BufferedWriter(fstream); + out.write("0"); + out.close(); + } catch (IOException e) { + s_logger.warn("Unable to disable rp_filter"); + } + } - private boolean copyCertToDirectory(String certificate, String filePath) - throws IOException { - boolean success; - // copy cert to the dir - FileWriter fstream = new FileWriter(filePath); - BufferedWriter out = new BufferedWriter(fstream); - out.write(certificate); - // Close the output stream - out.close(); - success = true; - return success; - } + private boolean copyCertToDirectory(String certificate, String filePath) + throws IOException { + boolean success; + // copy cert to the dir + FileWriter fstream = new FileWriter(filePath); + BufferedWriter out = new BufferedWriter(fstream); + out.write(certificate); + // Close the output stream + out.close(); + success = true; + return success; + } - protected Answer execute(final CheckConsoleProxyLoadCommand cmd) { - return executeProxyLoadScan(cmd, cmd.getProxyVmId(), - cmd.getProxyVmName(), cmd.getProxyManagementIp(), - cmd.getProxyCmdPort()); - } + protected Answer execute(final CheckConsoleProxyLoadCommand cmd) { + return executeProxyLoadScan(cmd, cmd.getProxyVmId(), + cmd.getProxyVmName(), cmd.getProxyManagementIp(), + cmd.getProxyCmdPort()); + } - protected Answer execute(final WatchConsoleProxyLoadCommand cmd) { - return executeProxyLoadScan(cmd, cmd.getProxyVmId(), - cmd.getProxyVmName(), cmd.getProxyManagementIp(), - cmd.getProxyCmdPort()); - } + protected Answer execute(final WatchConsoleProxyLoadCommand cmd) { + return executeProxyLoadScan(cmd, cmd.getProxyVmId(), + cmd.getProxyVmName(), cmd.getProxyManagementIp(), + cmd.getProxyCmdPort()); + } - private Answer executeProxyLoadScan(final Command cmd, - final long proxyVmId, final String proxyVmName, - final String proxyManagementIp, final int cmdPort) { - String result = null; + private Answer executeProxyLoadScan(final Command cmd, + final long proxyVmId, final String proxyVmName, + final String proxyManagementIp, final int cmdPort) { + String result = null; - final StringBuffer sb = new StringBuffer(); - sb.append("http://").append(proxyManagementIp).append(":" + cmdPort) - .append("/cmd/getstatus"); + final StringBuffer sb = new StringBuffer(); + sb.append("http://").append(proxyManagementIp).append(":" + cmdPort) + .append("/cmd/getstatus"); - boolean success = true; - try { - final URL url = new URL(sb.toString()); - final URLConnection conn = url.openConnection(); + boolean success = true; + try { + final URL url = new URL(sb.toString()); + final URLConnection conn = url.openConnection(); - final InputStream is = conn.getInputStream(); - final BufferedReader reader = new BufferedReader( - new InputStreamReader(is)); - final StringBuilder sb2 = new StringBuilder(); - String line = null; - try { - while ((line = reader.readLine()) != null) - sb2.append(line + "\n"); - result = sb2.toString(); - } catch (final IOException e) { - success = false; - } finally { - try { - is.close(); - } catch (final IOException e) { - s_logger.warn("Exception when closing , console proxy address : " - + proxyManagementIp); - success = false; - } - } - } catch (final IOException e) { - s_logger.warn("Unable to open console proxy command port url, console proxy address : " - + proxyManagementIp); - success = false; - } + final InputStream is = conn.getInputStream(); + final BufferedReader reader = new BufferedReader( + new InputStreamReader(is)); + final StringBuilder sb2 = new StringBuilder(); + String line = null; + try { + while ((line = reader.readLine()) != null) + sb2.append(line + "\n"); + result = sb2.toString(); + } catch (final IOException e) { + success = false; + } finally { + try { + is.close(); + } catch (final IOException e) { + s_logger.warn("Exception when closing , console proxy address : " + + proxyManagementIp); + success = false; + } + } + } catch (final IOException e) { + s_logger.warn("Unable to open console proxy command port url, console proxy address : " + + proxyManagementIp); + success = false; + } - return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, - result); - } + return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, + result); + } - @Override - protected String getDefaultScriptsDir() { - return null; - } + @Override + protected String getDefaultScriptsDir() { + return null; + } - public Type getType() { - return Host.Type.ConsoleProxy; - } + public Type getType() { + return Host.Type.ConsoleProxy; + } - @Override - public synchronized StartupCommand[] initialize() { - final StartupProxyCommand cmd = new StartupProxyCommand(); - fillNetworkInformation(cmd); - cmd.setProxyPort(_proxyPort); - cmd.setProxyVmId(_proxyVmId); - if (_pubIp != null) - cmd.setPublicIpAddress(_pubIp); - return new StartupCommand[] { cmd }; - } + @Override + public synchronized StartupCommand[] initialize() { + final StartupProxyCommand cmd = new StartupProxyCommand(); + fillNetworkInformation(cmd); + cmd.setProxyPort(_proxyPort); + cmd.setProxyVmId(_proxyVmId); + if (_pubIp != null) + cmd.setPublicIpAddress(_pubIp); + return new StartupCommand[] { cmd }; + } - @Override - public void disconnected() { - } + @Override + public void disconnected() { + } - @Override - public PingCommand getCurrentStatus(long id) { - return new PingCommand(Type.ConsoleProxy, id); - } + @Override + public PingCommand getCurrentStatus(long id) { + return new PingCommand(Type.ConsoleProxy, id); + } - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - _localgw = (String) params.get("localgw"); - _eth1mask = (String) params.get("eth1mask"); - _eth1ip = (String) params.get("eth1ip"); - if (_eth1ip != null) { - params.put("private.network.device", "eth1"); - } else { - s_logger.warn("WARNING: eth1ip parameter is not found!"); - } + @Override + public boolean configure(String name, Map params) + throws ConfigurationException { + _localgw = (String) params.get("localgw"); + _eth1mask = (String) params.get("eth1mask"); + _eth1ip = (String) params.get("eth1ip"); + if (_eth1ip != null) { + params.put("private.network.device", "eth1"); + } else { + s_logger.warn("WARNING: eth1ip parameter is not found!"); + } - String eth2ip = (String) params.get("eth2ip"); - if (eth2ip != null) { - params.put("public.network.device", "eth2"); - } else { - s_logger.warn("WARNING: eth2ip parameter is not found!"); - } + String eth2ip = (String) params.get("eth2ip"); + if (eth2ip != null) { + params.put("public.network.device", "eth2"); + } else { + s_logger.warn("WARNING: eth2ip parameter is not found!"); + } - super.configure(name, params); + super.configure(name, params); - for (Map.Entry entry : params.entrySet()) { - _properties.put(entry.getKey(), entry.getValue()); - } + for (Map.Entry entry : params.entrySet()) { + _properties.put(entry.getKey(), entry.getValue()); + } - String value = (String) params.get("premium"); - if (value != null && value.equals("premium")) - _proxyPort = 443; - else { - value = (String) params.get("consoleproxy.httpListenPort"); - _proxyPort = NumbersUtil.parseInt(value, 80); - } + String value = (String) params.get("premium"); + if (value != null && value.equals("premium")) + _proxyPort = 443; + else { + value = (String) params.get("consoleproxy.httpListenPort"); + _proxyPort = NumbersUtil.parseInt(value, 80); + } - value = (String) params.get("proxy_vm"); - _proxyVmId = NumbersUtil.parseLong(value, 0); + value = (String) params.get("proxy_vm"); + _proxyVmId = NumbersUtil.parseLong(value, 0); - if (_localgw != null) { - String mgmtHost = (String) params.get("host"); - addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost); + if (_localgw != null) { + String mgmtHost = (String) params.get("host"); + addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost); - String internalDns1 = (String) params.get("internaldns1"); - if (internalDns1 == null) { - s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage"); - } else { - addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, - internalDns1); - } + String internalDns1 = (String) params.get("internaldns1"); + if (internalDns1 == null) { + s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage"); + } else { + addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, + internalDns1); + } - String internalDns2 = (String) params.get("internaldns2"); - if (internalDns2 != null) { - addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, - internalDns2); - } - } + String internalDns2 = (String) params.get("internaldns2"); + if (internalDns2 != null) { + addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, + internalDns2); + } + } - _pubIp = (String) params.get("public.ip"); + _pubIp = (String) params.get("public.ip"); - value = (String) params.get("disable_rp_filter"); - if (value != null && value.equalsIgnoreCase("true")) { - disableRpFilter(); - } + value = (String) params.get("disable_rp_filter"); + if (value != null && value.equalsIgnoreCase("true")) { + disableRpFilter(); + } - if (s_logger.isInfoEnabled()) - s_logger.info("Receive proxyVmId in ConsoleProxyResource configuration as " - + _proxyVmId); + if (s_logger.isInfoEnabled()) + s_logger.info("Receive proxyVmId in ConsoleProxyResource configuration as " + + _proxyVmId); - return true; - } + return true; + } - private void addRouteToInternalIpOrCidr(String localgw, String eth1ip, - String eth1mask, String destIpOrCidr) { - s_logger.debug("addRouteToInternalIp: localgw=" + localgw + ", eth1ip=" - + eth1ip + ", eth1mask=" + eth1mask + ",destIp=" + destIpOrCidr); - if (destIpOrCidr == null) { - s_logger.debug("addRouteToInternalIp: destIp is null"); - return; - } - if (!NetUtils.isValidIp(destIpOrCidr) - && !NetUtils.isValidCIDR(destIpOrCidr)) { - s_logger.warn(" destIp is not a valid ip address or cidr destIp=" - + destIpOrCidr); - return; - } - boolean inSameSubnet = false; - if (NetUtils.isValidIp(destIpOrCidr)) { - if (eth1ip != null && eth1mask != null) { - inSameSubnet = NetUtils.sameSubnet(eth1ip, destIpOrCidr, - eth1mask); - } else { - s_logger.warn("addRouteToInternalIp: unable to determine same subnet: _eth1ip=" - + eth1ip - + ", dest ip=" - + destIpOrCidr - + ", _eth1mask=" - + eth1mask); - } - } else { - inSameSubnet = NetUtils.isNetworkAWithinNetworkB(destIpOrCidr, - NetUtils.ipAndNetMaskToCidr(eth1ip, eth1mask)); - } - if (inSameSubnet) { - s_logger.debug("addRouteToInternalIp: dest ip " + destIpOrCidr - + " is in the same subnet as eth1 ip " + eth1ip); - return; - } - Script command = new Script("/bin/bash", s_logger); - command.add("-c"); - command.add("ip route delete " + destIpOrCidr); - command.execute(); - command = new Script("/bin/bash", s_logger); - command.add("-c"); - command.add("ip route add " + destIpOrCidr + " via " + localgw); - String result = command.execute(); - if (result != null) { - s_logger.warn("Error in configuring route to internal ip err=" - + result); - } else { - s_logger.debug("addRouteToInternalIp: added route to internal ip=" - + destIpOrCidr + " via " + localgw); - } - } + private void addRouteToInternalIpOrCidr(String localgw, String eth1ip, + String eth1mask, String destIpOrCidr) { + s_logger.debug("addRouteToInternalIp: localgw=" + localgw + ", eth1ip=" + + eth1ip + ", eth1mask=" + eth1mask + ",destIp=" + destIpOrCidr); + if (destIpOrCidr == null) { + s_logger.debug("addRouteToInternalIp: destIp is null"); + return; + } + if (!NetUtils.isValidIp(destIpOrCidr) + && !NetUtils.isValidCIDR(destIpOrCidr)) { + s_logger.warn(" destIp is not a valid ip address or cidr destIp=" + + destIpOrCidr); + return; + } + boolean inSameSubnet = false; + if (NetUtils.isValidIp(destIpOrCidr)) { + if (eth1ip != null && eth1mask != null) { + inSameSubnet = NetUtils.sameSubnet(eth1ip, destIpOrCidr, + eth1mask); + } else { + s_logger.warn("addRouteToInternalIp: unable to determine same subnet: _eth1ip=" + + eth1ip + + ", dest ip=" + + destIpOrCidr + + ", _eth1mask=" + + eth1mask); + } + } else { + inSameSubnet = NetUtils.isNetworkAWithinNetworkB(destIpOrCidr, + NetUtils.ipAndNetMaskToCidr(eth1ip, eth1mask)); + } + if (inSameSubnet) { + s_logger.debug("addRouteToInternalIp: dest ip " + destIpOrCidr + + " is in the same subnet as eth1 ip " + eth1ip); + return; + } + Script command = new Script("/bin/bash", s_logger); + command.add("-c"); + command.add("ip route delete " + destIpOrCidr); + command.execute(); + command = new Script("/bin/bash", s_logger); + command.add("-c"); + command.add("ip route add " + destIpOrCidr + " via " + localgw); + String result = command.execute(); + if (result != null) { + s_logger.warn("Error in configuring route to internal ip err=" + + result); + } else { + s_logger.debug("addRouteToInternalIp: added route to internal ip=" + + destIpOrCidr + " via " + localgw); + } + } - @Override - public String getName() { - return _name; - } + @Override + public String getName() { + return _name; + } - private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, final String encryptorPassword) { - final Object resource = this; - if (_consoleProxyMain == null) { - _consoleProxyMain = new Thread(new Runnable() { - public void run() { - try { - Class consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy"); - try { - Method methodSetup = consoleProxyClazz.getMethod( - "setEncryptorPassword", String.class); - methodSetup.invoke(null, encryptorPassword); - - Method method = consoleProxyClazz.getMethod( - "startWithContext", Properties.class, - Object.class, byte[].class, String.class); - method.invoke(null, _properties, resource, ksBits, - ksPassword); - } catch (SecurityException e) { - s_logger.error("Unable to launch console proxy due to SecurityException"); - System.exit(ExitStatus.Error.value()); - } catch (NoSuchMethodException e) { - s_logger.error("Unable to launch console proxy due to NoSuchMethodException"); - System.exit(ExitStatus.Error.value()); - } catch (IllegalArgumentException e) { - s_logger.error("Unable to launch console proxy due to IllegalArgumentException"); - System.exit(ExitStatus.Error.value()); - } catch (IllegalAccessException e) { - s_logger.error("Unable to launch console proxy due to IllegalAccessException"); - System.exit(ExitStatus.Error.value()); - } catch (InvocationTargetException e) { - s_logger.error("Unable to launch console proxy due to InvocationTargetException"); - System.exit(ExitStatus.Error.value()); - } - } catch (final ClassNotFoundException e) { - s_logger.error("Unable to launch console proxy due to ClassNotFoundException"); - System.exit(ExitStatus.Error.value()); - } - } - }, "Console-Proxy-Main"); - _consoleProxyMain.setDaemon(true); - _consoleProxyMain.start(); - } else { - s_logger.info("com.cloud.consoleproxy.ConsoleProxy is already running"); - - try { - Class consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy"); - Method methodSetup = consoleProxyClazz.getMethod("setEncryptorPassword", String.class); - methodSetup.invoke(null, encryptorPassword); - } catch (SecurityException e) { - s_logger.error("Unable to launch console proxy due to SecurityException"); - System.exit(ExitStatus.Error.value()); - } catch (NoSuchMethodException e) { - s_logger.error("Unable to launch console proxy due to NoSuchMethodException"); - System.exit(ExitStatus.Error.value()); - } catch (IllegalArgumentException e) { - s_logger.error("Unable to launch console proxy due to IllegalArgumentException"); - System.exit(ExitStatus.Error.value()); - } catch (IllegalAccessException e) { - s_logger.error("Unable to launch console proxy due to IllegalAccessException"); - System.exit(ExitStatus.Error.value()); - } catch (InvocationTargetException e) { - s_logger.error("Unable to launch console proxy due to InvocationTargetException"); - System.exit(ExitStatus.Error.value()); - } catch (final ClassNotFoundException e) { - s_logger.error("Unable to launch console proxy due to ClassNotFoundException"); - System.exit(ExitStatus.Error.value()); - } - } - } + private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, final String encryptorPassword) { + final Object resource = this; + if (_consoleProxyMain == null) { + _consoleProxyMain = new Thread(new Runnable() { + public void run() { + try { + Class consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy"); + try { + Method methodSetup = consoleProxyClazz.getMethod( + "setEncryptorPassword", String.class); + methodSetup.invoke(null, encryptorPassword); + + Method method = consoleProxyClazz.getMethod( + "startWithContext", Properties.class, + Object.class, byte[].class, String.class); + method.invoke(null, _properties, resource, ksBits, + ksPassword); + } catch (SecurityException e) { + s_logger.error("Unable to launch console proxy due to SecurityException"); + System.exit(ExitStatus.Error.value()); + } catch (NoSuchMethodException e) { + s_logger.error("Unable to launch console proxy due to NoSuchMethodException"); + System.exit(ExitStatus.Error.value()); + } catch (IllegalArgumentException e) { + s_logger.error("Unable to launch console proxy due to IllegalArgumentException"); + System.exit(ExitStatus.Error.value()); + } catch (IllegalAccessException e) { + s_logger.error("Unable to launch console proxy due to IllegalAccessException"); + System.exit(ExitStatus.Error.value()); + } catch (InvocationTargetException e) { + s_logger.error("Unable to launch console proxy due to InvocationTargetException"); + System.exit(ExitStatus.Error.value()); + } + } catch (final ClassNotFoundException e) { + s_logger.error("Unable to launch console proxy due to ClassNotFoundException"); + System.exit(ExitStatus.Error.value()); + } + } + }, "Console-Proxy-Main"); + _consoleProxyMain.setDaemon(true); + _consoleProxyMain.start(); + } else { + s_logger.info("com.cloud.consoleproxy.ConsoleProxy is already running"); + + try { + Class consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy"); + Method methodSetup = consoleProxyClazz.getMethod("setEncryptorPassword", String.class); + methodSetup.invoke(null, encryptorPassword); + } catch (SecurityException e) { + s_logger.error("Unable to launch console proxy due to SecurityException"); + System.exit(ExitStatus.Error.value()); + } catch (NoSuchMethodException e) { + s_logger.error("Unable to launch console proxy due to NoSuchMethodException"); + System.exit(ExitStatus.Error.value()); + } catch (IllegalArgumentException e) { + s_logger.error("Unable to launch console proxy due to IllegalArgumentException"); + System.exit(ExitStatus.Error.value()); + } catch (IllegalAccessException e) { + s_logger.error("Unable to launch console proxy due to IllegalAccessException"); + System.exit(ExitStatus.Error.value()); + } catch (InvocationTargetException e) { + s_logger.error("Unable to launch console proxy due to InvocationTargetException"); + System.exit(ExitStatus.Error.value()); + } catch (final ClassNotFoundException e) { + s_logger.error("Unable to launch console proxy due to ClassNotFoundException"); + System.exit(ExitStatus.Error.value()); + } + } + } - public String authenticateConsoleAccess(String host, String port, - String vmId, String sid, String ticket, Boolean isReauthentication) { - - ConsoleAccessAuthenticationCommand cmd = new ConsoleAccessAuthenticationCommand( - host, port, vmId, sid, ticket); - cmd.setReauthenticating(isReauthentication); - - ConsoleProxyAuthenticationResult result = new ConsoleProxyAuthenticationResult(); - result.setSuccess(false); - result.setReauthentication(isReauthentication); + public String authenticateConsoleAccess(String host, String port, + String vmId, String sid, String ticket, Boolean isReauthentication) { + + ConsoleAccessAuthenticationCommand cmd = new ConsoleAccessAuthenticationCommand( + host, port, vmId, sid, ticket); + cmd.setReauthenticating(isReauthentication); + + ConsoleProxyAuthenticationResult result = new ConsoleProxyAuthenticationResult(); + result.setSuccess(false); + result.setReauthentication(isReauthentication); - try { - AgentControlAnswer answer = getAgentControl().sendRequest(cmd, 10000); - - if (answer != null) { - ConsoleAccessAuthenticationAnswer authAnswer = (ConsoleAccessAuthenticationAnswer)answer; - result.setSuccess(authAnswer.succeeded()); - result.setHost(authAnswer.getHost()); - result.setPort(authAnswer.getPort()); - result.setTunnelUrl(authAnswer.getTunnelUrl()); - result.setTunnelSession(authAnswer.getTunnelSession()); - } else { - s_logger.error("Authentication failed for vm: " + vmId + " with sid: " + sid); - } - } catch (AgentControlChannelException e) { - s_logger.error("Unable to send out console access authentication request due to " - + e.getMessage(), e); - } + try { + AgentControlAnswer answer = getAgentControl().sendRequest(cmd, 10000); + + if (answer != null) { + ConsoleAccessAuthenticationAnswer authAnswer = (ConsoleAccessAuthenticationAnswer)answer; + result.setSuccess(authAnswer.succeeded()); + result.setHost(authAnswer.getHost()); + result.setPort(authAnswer.getPort()); + result.setTunnelUrl(authAnswer.getTunnelUrl()); + result.setTunnelSession(authAnswer.getTunnelSession()); + } else { + s_logger.error("Authentication failed for vm: " + vmId + " with sid: " + sid); + } + } catch (AgentControlChannelException e) { + s_logger.error("Unable to send out console access authentication request due to " + + e.getMessage(), e); + } - return new Gson().toJson(result); - } + return new Gson().toJson(result); + } - public void reportLoadInfo(String gsonLoadInfo) { - ConsoleProxyLoadReportCommand cmd = new ConsoleProxyLoadReportCommand( - _proxyVmId, gsonLoadInfo); - try { - getAgentControl().postRequest(cmd); + public void reportLoadInfo(String gsonLoadInfo) { + ConsoleProxyLoadReportCommand cmd = new ConsoleProxyLoadReportCommand( + _proxyVmId, gsonLoadInfo); + try { + getAgentControl().postRequest(cmd); - if (s_logger.isDebugEnabled()) - s_logger.debug("Report proxy load info, proxy : " + _proxyVmId - + ", load: " + gsonLoadInfo); - } catch (AgentControlChannelException e) { - s_logger.error( - "Unable to send out load info due to " + e.getMessage(), e); - } - } + if (s_logger.isDebugEnabled()) + s_logger.debug("Report proxy load info, proxy : " + _proxyVmId + + ", load: " + gsonLoadInfo); + } catch (AgentControlChannelException e) { + s_logger.error( + "Unable to send out load info due to " + e.getMessage(), e); + } + } - public void ensureRoute(String address) { - if (_localgw != null) { - if (s_logger.isDebugEnabled()) - s_logger.debug("Ensure route for " + address + " via " - + _localgw); + public void ensureRoute(String address) { + if (_localgw != null) { + if (s_logger.isDebugEnabled()) + s_logger.debug("Ensure route for " + address + " via " + + _localgw); - // this method won't be called in high frequency, serialize access - // to script execution - synchronized (this) { - try { - addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, - address); - } catch (Throwable e) { - s_logger.warn( - "Unexpected exception while adding internal route to " - + address, e); - } - } - } - } + // this method won't be called in high frequency, serialize access + // to script execution + synchronized (this) { + try { + addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, + address); + } catch (Throwable e) { + s_logger.warn( + "Unexpected exception while adding internal route to " + + address, e); + } + } + } + } } diff --git a/agent/src/com/cloud/agent/storage/KVMPhysicalDisk.java b/agent/src/com/cloud/agent/storage/KVMPhysicalDisk.java index 81cd0f307e8..d0e43df9e61 100644 --- a/agent/src/com/cloud/agent/storage/KVMPhysicalDisk.java +++ b/agent/src/com/cloud/agent/storage/KVMPhysicalDisk.java @@ -17,66 +17,66 @@ package com.cloud.agent.storage; public class KVMPhysicalDisk { - private String path; - private String name; - private KVMStoragePool pool; + private String path; + private String name; + private KVMStoragePool pool; - public static enum PhysicalDiskFormat { - RAW("raw"), QCOW2("qcow2"); - String format; + public static enum PhysicalDiskFormat { + RAW("raw"), QCOW2("qcow2"); + String format; - private PhysicalDiskFormat(String format) { - this.format = format; - } + private PhysicalDiskFormat(String format) { + this.format = format; + } - public String toString() { - return this.format; - } - } + public String toString() { + return this.format; + } + } - private PhysicalDiskFormat format; - private long size; - private long virtualSize; + private PhysicalDiskFormat format; + private long size; + private long virtualSize; - public KVMPhysicalDisk(String path, String name, KVMStoragePool pool) { - this.path = path; - this.name = name; - this.pool = pool; - } + public KVMPhysicalDisk(String path, String name, KVMStoragePool pool) { + this.path = path; + this.name = name; + this.pool = pool; + } - public void setFormat(PhysicalDiskFormat format) { - this.format = format; - } + public void setFormat(PhysicalDiskFormat format) { + this.format = format; + } - public PhysicalDiskFormat getFormat() { - return this.format; - } + public PhysicalDiskFormat getFormat() { + return this.format; + } - public void setSize(long size) { - this.size = size; - } + public void setSize(long size) { + this.size = size; + } - public long getSize() { - return this.size; - } + public long getSize() { + return this.size; + } - public void setVirtualSize(long size) { - this.virtualSize = size; - } + public void setVirtualSize(long size) { + this.virtualSize = size; + } - public long getVirtualSize() { - return this.virtualSize; - } + public long getVirtualSize() { + return this.virtualSize; + } - public String getName() { - return this.name; - } + public String getName() { + return this.name; + } - public String getPath() { - return this.path; - } + public String getPath() { + return this.path; + } - public KVMStoragePool getPool() { - return this.pool; - } + public KVMStoragePool getPool() { + return this.pool; + } } diff --git a/agent/src/com/cloud/agent/storage/KVMStoragePool.java b/agent/src/com/cloud/agent/storage/KVMStoragePool.java index 22deb5090d1..9961088bc02 100644 --- a/agent/src/com/cloud/agent/storage/KVMStoragePool.java +++ b/agent/src/com/cloud/agent/storage/KVMStoragePool.java @@ -22,34 +22,34 @@ import com.cloud.agent.storage.KVMPhysicalDisk.PhysicalDiskFormat; import com.cloud.storage.Storage.StoragePoolType; public interface KVMStoragePool { - public KVMPhysicalDisk createPhysicalDisk(String name, - PhysicalDiskFormat format, long size); + public KVMPhysicalDisk createPhysicalDisk(String name, + PhysicalDiskFormat format, long size); - public KVMPhysicalDisk createPhysicalDisk(String name, long size); + public KVMPhysicalDisk createPhysicalDisk(String name, long size); - public KVMPhysicalDisk getPhysicalDisk(String volumeUuid); + public KVMPhysicalDisk getPhysicalDisk(String volumeUuid); - public boolean deletePhysicalDisk(String uuid); + public boolean deletePhysicalDisk(String uuid); - public List listPhysicalDisks(); + public List listPhysicalDisks(); - public String getUuid(); + public String getUuid(); - public long getCapacity(); + public long getCapacity(); - public long getUsed(); + public long getUsed(); - public boolean refresh(); + public boolean refresh(); - public boolean isExternalSnapshot(); + public boolean isExternalSnapshot(); - public String getLocalPath(); + public String getLocalPath(); - public StoragePoolType getType(); + public StoragePoolType getType(); - public boolean delete(); + public boolean delete(); - PhysicalDiskFormat getDefaultFormat(); + PhysicalDiskFormat getDefaultFormat(); - public boolean createFolder(String path); + public boolean createFolder(String path); } diff --git a/agent/src/com/cloud/agent/storage/KVMStoragePoolManager.java b/agent/src/com/cloud/agent/storage/KVMStoragePoolManager.java index 21be5e9f48e..53373e50b45 100644 --- a/agent/src/com/cloud/agent/storage/KVMStoragePoolManager.java +++ b/agent/src/com/cloud/agent/storage/KVMStoragePoolManager.java @@ -27,78 +27,78 @@ import com.cloud.storage.Storage.StoragePoolType; import com.cloud.storage.StorageLayer; public class KVMStoragePoolManager { - private StorageAdaptor _storageAdaptor; - private KVMHAMonitor _haMonitor; - private final Map _storagePools = new ConcurrentHashMap(); + private StorageAdaptor _storageAdaptor; + private KVMHAMonitor _haMonitor; + private final Map _storagePools = new ConcurrentHashMap(); - private void addStoragePool(String uuid) { - synchronized (_storagePools) { - if (!_storagePools.containsKey(uuid)) { - _storagePools.put(uuid, new Object()); - } - } - } + private void addStoragePool(String uuid) { + synchronized (_storagePools) { + if (!_storagePools.containsKey(uuid)) { + _storagePools.put(uuid, new Object()); + } + } + } - public KVMStoragePoolManager(StorageLayer storagelayer, KVMHAMonitor monitor) { - this._storageAdaptor = new LibvirtStorageAdaptor(storagelayer); - this._haMonitor = monitor; - } + public KVMStoragePoolManager(StorageLayer storagelayer, KVMHAMonitor monitor) { + this._storageAdaptor = new LibvirtStorageAdaptor(storagelayer); + this._haMonitor = monitor; + } - public KVMStoragePool getStoragePool(String uuid) { - return this._storageAdaptor.getStoragePool(uuid); - } + public KVMStoragePool getStoragePool(String uuid) { + return this._storageAdaptor.getStoragePool(uuid); + } - public KVMStoragePool getStoragePoolByURI(String uri) { - return this._storageAdaptor.getStoragePoolByUri(uri); - } + public KVMStoragePool getStoragePoolByURI(String uri) { + return this._storageAdaptor.getStoragePoolByUri(uri); + } - public KVMStoragePool createStoragePool(String name, String host, - String path, StoragePoolType type) { - KVMStoragePool pool = this._storageAdaptor.createStoragePool(name, - host, path, type); - if (type == StoragePoolType.NetworkFilesystem) { - KVMHABase.NfsStoragePool nfspool = new KVMHABase.NfsStoragePool( - pool.getUuid(), host, path, pool.getLocalPath(), - PoolType.PrimaryStorage); - _haMonitor.addStoragePool(nfspool); - } - addStoragePool(pool.getUuid()); - return pool; - } + public KVMStoragePool createStoragePool(String name, String host, + String path, StoragePoolType type) { + KVMStoragePool pool = this._storageAdaptor.createStoragePool(name, + host, path, type); + if (type == StoragePoolType.NetworkFilesystem) { + KVMHABase.NfsStoragePool nfspool = new KVMHABase.NfsStoragePool( + pool.getUuid(), host, path, pool.getLocalPath(), + PoolType.PrimaryStorage); + _haMonitor.addStoragePool(nfspool); + } + addStoragePool(pool.getUuid()); + return pool; + } - public boolean deleteStoragePool(String uuid) { - _haMonitor.removeStoragePool(uuid); - this._storageAdaptor.deleteStoragePool(uuid); - _storagePools.remove(uuid); - return true; - } + public boolean deleteStoragePool(String uuid) { + _haMonitor.removeStoragePool(uuid); + this._storageAdaptor.deleteStoragePool(uuid); + _storagePools.remove(uuid); + return true; + } - public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, - String name, KVMStoragePool destPool) { - return this._storageAdaptor.createDiskFromTemplate(template, name, - KVMPhysicalDisk.PhysicalDiskFormat.QCOW2, - template.getSize(), destPool); - } + public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, + String name, KVMStoragePool destPool) { + return this._storageAdaptor.createDiskFromTemplate(template, name, + KVMPhysicalDisk.PhysicalDiskFormat.QCOW2, + template.getSize(), destPool); + } - public KVMPhysicalDisk createTemplateFromDisk(KVMPhysicalDisk disk, - String name, PhysicalDiskFormat format, long size, - KVMStoragePool destPool) { - return this._storageAdaptor.createTemplateFromDisk(disk, name, format, - size, destPool); - } + public KVMPhysicalDisk createTemplateFromDisk(KVMPhysicalDisk disk, + String name, PhysicalDiskFormat format, long size, + KVMStoragePool destPool) { + return this._storageAdaptor.createTemplateFromDisk(disk, name, format, + size, destPool); + } - public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, - KVMStoragePool destPool) { - return this._storageAdaptor.copyPhysicalDisk(disk, name, destPool); - } + public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, + KVMStoragePool destPool) { + return this._storageAdaptor.copyPhysicalDisk(disk, name, destPool); + } - public KVMPhysicalDisk createDiskFromSnapshot(KVMPhysicalDisk snapshot, - String snapshotName, String name, KVMStoragePool destPool) { - return this._storageAdaptor.createDiskFromSnapshot(snapshot, - snapshotName, name, destPool); - } + public KVMPhysicalDisk createDiskFromSnapshot(KVMPhysicalDisk snapshot, + String snapshotName, String name, KVMStoragePool destPool) { + return this._storageAdaptor.createDiskFromSnapshot(snapshot, + snapshotName, name, destPool); + } - public KVMPhysicalDisk getPhysicalDiskFromUrl(String url) { - return this._storageAdaptor.getPhysicalDiskFromURI(url); - } + public KVMPhysicalDisk getPhysicalDiskFromUrl(String url) { + return this._storageAdaptor.getPhysicalDiskFromURI(url); + } } diff --git a/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java b/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java index 6ee69847d20..e1e050f75d5 100644 --- a/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java +++ b/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java @@ -47,657 +47,657 @@ import com.cloud.utils.script.OutputInterpreter; import com.cloud.utils.script.Script; public class LibvirtStorageAdaptor implements StorageAdaptor { - private static final Logger s_logger = Logger - .getLogger(LibvirtStorageAdaptor.class); - private StorageLayer _storageLayer; - private String _mountPoint = "/mnt"; - private String _manageSnapshotPath; - - public LibvirtStorageAdaptor(StorageLayer storage) { - _storageLayer = storage; - _manageSnapshotPath = Script.findScript("scripts/storage/qcow2/", - "managesnapshot.sh"); - } - - @Override - public boolean createFolder(String uuid, String path) { - String mountPoint = _mountPoint + File.separator + uuid; - File f = new File(mountPoint + path); - if (!f.exists()) { - f.mkdirs(); - } - return true; - } - - public StorageVol getVolume(StoragePool pool, String volName) { - StorageVol vol = null; - - try { - vol = pool.storageVolLookupByName(volName); - } catch (LibvirtException e) { - - } - if (vol == null) { - storagePoolRefresh(pool); - try { - vol = pool.storageVolLookupByName(volName); - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - } - return vol; - } - - public StorageVol createVolume(Connect conn, StoragePool pool, String uuid, - long size, volFormat format) throws LibvirtException { - LibvirtStorageVolumeDef volDef = new LibvirtStorageVolumeDef(UUID - .randomUUID().toString(), size, format, null, null); - s_logger.debug(volDef.toString()); - return pool.storageVolCreateXML(volDef.toString(), 0); - } - - public StoragePool getStoragePoolbyURI(Connect conn, URI uri) - throws LibvirtException { - String sourcePath; - String uuid; - String sourceHost = ""; - String protocal; - if (uri.getScheme().equalsIgnoreCase("local")) { - sourcePath = _mountPoint + File.separator - + uri.toString().replace("local:///", ""); - sourcePath = sourcePath.replace("//", "/"); - uuid = UUID.nameUUIDFromBytes(new String(sourcePath).getBytes()) - .toString(); - protocal = "DIR"; - } else { - sourcePath = uri.getPath(); - sourcePath = sourcePath.replace("//", "/"); - sourceHost = uri.getHost(); - uuid = UUID.nameUUIDFromBytes( - new String(sourceHost + sourcePath).getBytes()).toString(); - protocal = "NFS"; - } - - String targetPath = _mountPoint + File.separator + uuid; - StoragePool sp = null; - try { - sp = conn.storagePoolLookupByUUIDString(uuid); - } catch (LibvirtException e) { - } - - if (sp == null) { - try { - LibvirtStoragePoolDef spd = null; - if (protocal.equalsIgnoreCase("NFS")) { - _storageLayer.mkdir(targetPath); - spd = new LibvirtStoragePoolDef(poolType.NETFS, uuid, uuid, - sourceHost, sourcePath, targetPath); - s_logger.debug(spd.toString()); - // addStoragePool(uuid); - - } else if (protocal.equalsIgnoreCase("DIR")) { - _storageLayer.mkdir(targetPath); - spd = new LibvirtStoragePoolDef(poolType.DIR, uuid, uuid, - null, null, sourcePath); - } - - synchronized (getStoragePool(uuid)) { - sp = conn.storagePoolDefineXML(spd.toString(), 0); - - if (sp == null) { - s_logger.debug("Failed to define storage pool"); - return null; - } - sp.create(0); - } - - return sp; - } catch (LibvirtException e) { - try { - if (sp != null) { - sp.undefine(); - sp.free(); - } - } catch (LibvirtException l) { - - } - throw e; - } - } else { - StoragePoolInfo spi = sp.getInfo(); - if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { - sp.create(0); - } - return sp; - } - } - - public void storagePoolRefresh(StoragePool pool) { - try { - synchronized (getStoragePool(pool.getUUIDString())) { - pool.refresh(0); - } - } catch (LibvirtException e) { - - } - } - - private StoragePool createNfsStoragePool(Connect conn, String uuid, - String host, String path) { - String targetPath = _mountPoint + File.separator + uuid; - LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.NETFS, - uuid, uuid, host, path, targetPath); - _storageLayer.mkdir(targetPath); - StoragePool sp = null; - try { - s_logger.debug(spd.toString()); - sp = conn.storagePoolDefineXML(spd.toString(), 0); - sp.create(0); - return sp; - } catch (LibvirtException e) { - s_logger.debug(e.toString()); - if (sp != null) { - try { - sp.undefine(); - sp.free(); - } catch (LibvirtException l) { - s_logger.debug("Failed to define nfs storage pool with: " - + l.toString()); - } - } - return null; - } - } - - private StoragePool CreateSharedStoragePool(Connect conn, String uuid, - String host, String path) { - String mountPoint = path; - if (!_storageLayer.exists(mountPoint)) { - return null; - } - LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR, - uuid, uuid, host, path, path); - StoragePool sp = null; - try { - s_logger.debug(spd.toString()); - sp = conn.storagePoolDefineXML(spd.toString(), 0); - sp.create(0); - - return sp; - } catch (LibvirtException e) { - s_logger.debug(e.toString()); - if (sp != null) { - try { - sp.undefine(); - sp.free(); - } catch (LibvirtException l) { - s_logger.debug("Failed to define shared mount point storage pool with: " - + l.toString()); - } - } - return null; - } - } - - private StoragePool createCLVMStoragePool(Connect conn, String uuid, - String host, String path) { - - String volgroupPath = "/dev/" + path; - String volgroupName = path; - volgroupName = volgroupName.replaceFirst("/", ""); - - LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.LOGICAL, - volgroupName, uuid, host, volgroupPath, volgroupPath); - StoragePool sp = null; - try { - s_logger.debug(spd.toString()); - sp = conn.storagePoolDefineXML(spd.toString(), 0); - sp.create(0); - return sp; - } catch (LibvirtException e) { - s_logger.debug(e.toString()); - if (sp != null) { - try { - sp.undefine(); - sp.free(); - } catch (LibvirtException l) { - s_logger.debug("Failed to define clvm storage pool with: " - + l.toString()); - } - } - return null; - } - - } - - public StorageVol copyVolume(StoragePool destPool, - LibvirtStorageVolumeDef destVol, StorageVol srcVol, int timeout) - throws LibvirtException { - StorageVol vol = destPool.storageVolCreateXML(destVol.toString(), 0); - String srcPath = srcVol.getKey(); - String destPath = vol.getKey(); - Script.runSimpleBashScript("cp " + srcPath + " " + destPath, timeout); - return vol; - } - - public boolean copyVolume(String srcPath, String destPath, - String volumeName, int timeout) throws InternalErrorException { - _storageLayer.mkdirs(destPath); - if (!_storageLayer.exists(srcPath)) { - throw new InternalErrorException("volume:" + srcPath - + " is not exits"); - } - String result = Script.runSimpleBashScript("cp " + srcPath + " " - + destPath + File.separator + volumeName, timeout); - if (result != null) { - return false; - } else { - return true; - } - } - - public LibvirtStoragePoolDef getStoragePoolDef(Connect conn, - StoragePool pool) throws LibvirtException { - String poolDefXML = pool.getXMLDesc(0); - LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); - return parser.parseStoragePoolXML(poolDefXML); - } - - public LibvirtStorageVolumeDef getStorageVolumeDef(Connect conn, - StorageVol vol) throws LibvirtException { - String volDefXML = vol.getXMLDesc(0); - LibvirtStorageVolumeXMLParser parser = new LibvirtStorageVolumeXMLParser(); - return parser.parseStorageVolumeXML(volDefXML); - } - - public StorageVol getVolumeFromURI(Connect conn, String volPath) - throws LibvirtException, URISyntaxException { - int index = volPath.lastIndexOf("/"); - URI volDir = null; - StoragePool sp = null; - StorageVol vol = null; - try { - volDir = new URI(volPath.substring(0, index)); - String volName = volPath.substring(index + 1); - sp = getStoragePoolbyURI(conn, volDir); - vol = sp.storageVolLookupByName(volName); - return vol; - } catch (LibvirtException e) { - s_logger.debug("Faild to get vol path: " + e.toString()); - throw e; - } finally { - try { - if (sp != null) { - sp.free(); - } - } catch (LibvirtException e) { - - } - } - } - - public StoragePool createFileBasedStoragePool(Connect conn, - String localStoragePath, String uuid) { - if (!(_storageLayer.exists(localStoragePath) && _storageLayer - .isDirectory(localStoragePath))) { - return null; - } - - File path = new File(localStoragePath); - if (!(path.canWrite() && path.canRead() && path.canExecute())) { - return null; - } - - StoragePool pool = null; - - try { - pool = conn.storagePoolLookupByUUIDString(uuid); - } catch (LibvirtException e) { - - } - - if (pool == null) { - LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR, - uuid, uuid, null, null, localStoragePath); - try { - pool = conn.storagePoolDefineXML(spd.toString(), 0); - pool.create(0); - } catch (LibvirtException e) { - if (pool != null) { - try { - pool.destroy(); - pool.undefine(); - } catch (LibvirtException e1) { - } - pool = null; - } - throw new CloudRuntimeException(e.toString()); - } - } - - try { - StoragePoolInfo spi = pool.getInfo(); - if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { - pool.create(0); - } - - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - - return pool; - } - - private void getStats(LibvirtStoragePool pool) { - Script statsScript = new Script("/bin/bash", s_logger); - statsScript.add("-c"); - statsScript.add("stats=$(df --total " + pool.getLocalPath() - + " |grep total|awk '{print $2,$3}');echo $stats"); - final OutputInterpreter.OneLineParser statsParser = new OutputInterpreter.OneLineParser(); - String result = statsScript.execute(statsParser); - if (result == null) { - String stats = statsParser.getLine(); - if (stats != null && !stats.isEmpty()) { - String sizes[] = stats.trim().split(" "); - if (sizes.length == 2) { - pool.setCapacity(Long.parseLong(sizes[0]) * 1024); - pool.setUsed(Long.parseLong(sizes[1]) * 1024); - } - } - } - } - - @Override - public KVMStoragePool getStoragePool(String uuid) { - StoragePool storage = null; - try { - Connect conn = LibvirtConnection.getConnection(); - storage = conn.storagePoolLookupByUUIDString(uuid); - - if (storage.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { - storage.create(0); - } - LibvirtStoragePoolDef spd = getStoragePoolDef(conn, storage); - StoragePoolType type = null; - if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.NETFS - || spd.getPoolType() == LibvirtStoragePoolDef.poolType.DIR) { - type = StoragePoolType.Filesystem; - } - LibvirtStoragePool pool = new LibvirtStoragePool(uuid, - storage.getName(), type, this, storage); - pool.setLocalPath(spd.getTargetPath()); - getStats(pool); - return pool; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - } - - @Override - public KVMPhysicalDisk getPhysicalDisk(String volumeUuid, - KVMStoragePool pool) { - LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - - try { - StorageVol vol = this.getVolume(libvirtPool.getPool(), volumeUuid); - KVMPhysicalDisk disk; - LibvirtStorageVolumeDef voldef = getStorageVolumeDef(libvirtPool - .getPool().getConnect(), vol); - disk = new KVMPhysicalDisk(vol.getPath(), vol.getName(), pool); - disk.setSize(vol.getInfo().allocation); - disk.setVirtualSize(vol.getInfo().capacity); - if (voldef.getFormat() == null) { - disk.setFormat(pool.getDefaultFormat()); - } else if (voldef.getFormat() == LibvirtStorageVolumeDef.volFormat.QCOW2) { - disk.setFormat(KVMPhysicalDisk.PhysicalDiskFormat.QCOW2); - } else if (voldef.getFormat() == LibvirtStorageVolumeDef.volFormat.RAW) { - disk.setFormat(KVMPhysicalDisk.PhysicalDiskFormat.RAW); - } - return disk; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - - } - - @Override - public KVMStoragePool createStoragePool(String name, String host, - String path, StoragePoolType type) { - StoragePool sp = null; - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - - try { - sp = conn.storagePoolLookupByUUIDString(name); - if (sp.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { - sp.undefine(); - sp = null; - } - } catch (LibvirtException e) { - - } - - if (sp == null) { - if (type == StoragePoolType.NetworkFilesystem) { - sp = createNfsStoragePool(conn, name, host, path); - } else if (type == StoragePoolType.SharedMountPoint - || type == StoragePoolType.Filesystem) { - sp = CreateSharedStoragePool(conn, name, host, path); - } - } - - try { - StoragePoolInfo spi = sp.getInfo(); - if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { - sp.create(0); - } - - LibvirtStoragePoolDef spd = getStoragePoolDef(conn, sp); - LibvirtStoragePool pool = new LibvirtStoragePool(name, - sp.getName(), type, this, sp); - pool.setLocalPath(spd.getTargetPath()); - - getStats(pool); - - return pool; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - - } - - @Override - public boolean deleteStoragePool(String uuid) { - Connect conn = null; - try { - conn = LibvirtConnection.getConnection(); - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - - StoragePool sp = null; - - try { - sp = conn.storagePoolLookupByUUIDString(uuid); - } catch (LibvirtException e) { - return true; - } - - try { - sp.destroy(); - sp.undefine(); - sp.free(); - return true; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - } - - @Override - public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, - PhysicalDiskFormat format, long size) { - LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - StoragePool virtPool = libvirtPool.getPool(); - LibvirtStorageVolumeDef.volFormat libvirtformat = null; - if (format == PhysicalDiskFormat.QCOW2) { - libvirtformat = LibvirtStorageVolumeDef.volFormat.QCOW2; - } else if (format == PhysicalDiskFormat.RAW) { - libvirtformat = LibvirtStorageVolumeDef.volFormat.RAW; - } - - LibvirtStorageVolumeDef volDef = new LibvirtStorageVolumeDef(name, - size, libvirtformat, null, null); - s_logger.debug(volDef.toString()); - try { - StorageVol vol = virtPool.storageVolCreateXML(volDef.toString(), 0); - KVMPhysicalDisk disk = new KVMPhysicalDisk(vol.getPath(), - vol.getName(), pool); - disk.setFormat(format); - disk.setSize(vol.getInfo().allocation); - disk.setVirtualSize(vol.getInfo().capacity); - return disk; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - } - - @Override - public boolean deletePhysicalDisk(String uuid, KVMStoragePool pool) { - LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - try { - StorageVol vol = this.getVolume(libvirtPool.getPool(), uuid); - vol.delete(0); - vol.free(); - return true; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - } - - @Override - public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, - String name, PhysicalDiskFormat format, long size, - KVMStoragePool destPool) { - KVMPhysicalDisk disk = destPool.createPhysicalDisk(UUID.randomUUID() - .toString(), format, template.getVirtualSize()); - - if (format == PhysicalDiskFormat.QCOW2) { - Script.runSimpleBashScript("qemu-img create -f " - + template.getFormat() + " -b " + template.getPath() + " " - + disk.getPath()); - } else if (format == PhysicalDiskFormat.RAW) { - Script.runSimpleBashScript("qemu-img convert -f " - + template.getFormat() + " -O raw " + template.getPath() - + " " + disk.getPath()); - } - return disk; - } - - @Override - public KVMPhysicalDisk createTemplateFromDisk(KVMPhysicalDisk disk, - String name, PhysicalDiskFormat format, long size, - KVMStoragePool destPool) { - return null; - } - - @Override - public List listPhysicalDisks(String storagePoolUuid, - KVMStoragePool pool) { - LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - StoragePool virtPool = libvirtPool.getPool(); - List disks = new ArrayList(); - try { - String[] vols = virtPool.listVolumes(); - for (String volName : vols) { - KVMPhysicalDisk disk = this.getPhysicalDisk(volName, pool); - disks.add(disk); - } - return disks; - } catch (LibvirtException e) { - throw new CloudRuntimeException(e.toString()); - } - } - - @Override - public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, - KVMStoragePool destPool) { - KVMPhysicalDisk newDisk = destPool.createPhysicalDisk(name, - disk.getVirtualSize()); - String sourcePath = disk.getPath(); - String destPath = newDisk.getPath(); - - Script.runSimpleBashScript("qemu-img convert -f " + disk.getFormat() - + " -O " + newDisk.getFormat() + " " + sourcePath + " " - + destPath); - return newDisk; - } - - @Override - public KVMStoragePool getStoragePoolByUri(String uri) { - URI storageUri = null; - - try { - storageUri = new URI(uri); - } catch (URISyntaxException e) { - throw new CloudRuntimeException(e.toString()); - } - - String sourcePath = null; - String uuid = null; - String sourceHost = ""; - StoragePoolType protocal = null; - if (storageUri.getScheme().equalsIgnoreCase("nfs")) { - sourcePath = storageUri.getPath(); - sourcePath = sourcePath.replace("//", "/"); - sourceHost = storageUri.getHost(); - uuid = UUID.randomUUID().toString(); - protocal = StoragePoolType.NetworkFilesystem; - } - - return createStoragePool(uuid, sourceHost, sourcePath, protocal); - } - - @Override - public KVMPhysicalDisk getPhysicalDiskFromURI(String uri) { - // TODO Auto-generated method stub - return null; - } - - @Override - public KVMPhysicalDisk createDiskFromSnapshot(KVMPhysicalDisk snapshot, - String snapshotName, String name, KVMStoragePool destPool) { - return null; - } - - @Override - public boolean refresh(KVMStoragePool pool) { - LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - StoragePool virtPool = libvirtPool.getPool(); - try { - virtPool.refresh(0); - } catch (LibvirtException e) { - return false; - } - return true; - } - - @Override - public boolean deleteStoragePool(KVMStoragePool pool) { - LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - StoragePool virtPool = libvirtPool.getPool(); - try { - virtPool.destroy(); - virtPool.undefine(); - virtPool.free(); - } catch (LibvirtException e) { - return false; - } - - return true; - } + private static final Logger s_logger = Logger + .getLogger(LibvirtStorageAdaptor.class); + private StorageLayer _storageLayer; + private String _mountPoint = "/mnt"; + private String _manageSnapshotPath; + + public LibvirtStorageAdaptor(StorageLayer storage) { + _storageLayer = storage; + _manageSnapshotPath = Script.findScript("scripts/storage/qcow2/", + "managesnapshot.sh"); + } + + @Override + public boolean createFolder(String uuid, String path) { + String mountPoint = _mountPoint + File.separator + uuid; + File f = new File(mountPoint + path); + if (!f.exists()) { + f.mkdirs(); + } + return true; + } + + public StorageVol getVolume(StoragePool pool, String volName) { + StorageVol vol = null; + + try { + vol = pool.storageVolLookupByName(volName); + } catch (LibvirtException e) { + + } + if (vol == null) { + storagePoolRefresh(pool); + try { + vol = pool.storageVolLookupByName(volName); + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + } + return vol; + } + + public StorageVol createVolume(Connect conn, StoragePool pool, String uuid, + long size, volFormat format) throws LibvirtException { + LibvirtStorageVolumeDef volDef = new LibvirtStorageVolumeDef(UUID + .randomUUID().toString(), size, format, null, null); + s_logger.debug(volDef.toString()); + return pool.storageVolCreateXML(volDef.toString(), 0); + } + + public StoragePool getStoragePoolbyURI(Connect conn, URI uri) + throws LibvirtException { + String sourcePath; + String uuid; + String sourceHost = ""; + String protocal; + if (uri.getScheme().equalsIgnoreCase("local")) { + sourcePath = _mountPoint + File.separator + + uri.toString().replace("local:///", ""); + sourcePath = sourcePath.replace("//", "/"); + uuid = UUID.nameUUIDFromBytes(new String(sourcePath).getBytes()) + .toString(); + protocal = "DIR"; + } else { + sourcePath = uri.getPath(); + sourcePath = sourcePath.replace("//", "/"); + sourceHost = uri.getHost(); + uuid = UUID.nameUUIDFromBytes( + new String(sourceHost + sourcePath).getBytes()).toString(); + protocal = "NFS"; + } + + String targetPath = _mountPoint + File.separator + uuid; + StoragePool sp = null; + try { + sp = conn.storagePoolLookupByUUIDString(uuid); + } catch (LibvirtException e) { + } + + if (sp == null) { + try { + LibvirtStoragePoolDef spd = null; + if (protocal.equalsIgnoreCase("NFS")) { + _storageLayer.mkdir(targetPath); + spd = new LibvirtStoragePoolDef(poolType.NETFS, uuid, uuid, + sourceHost, sourcePath, targetPath); + s_logger.debug(spd.toString()); + // addStoragePool(uuid); + + } else if (protocal.equalsIgnoreCase("DIR")) { + _storageLayer.mkdir(targetPath); + spd = new LibvirtStoragePoolDef(poolType.DIR, uuid, uuid, + null, null, sourcePath); + } + + synchronized (getStoragePool(uuid)) { + sp = conn.storagePoolDefineXML(spd.toString(), 0); + + if (sp == null) { + s_logger.debug("Failed to define storage pool"); + return null; + } + sp.create(0); + } + + return sp; + } catch (LibvirtException e) { + try { + if (sp != null) { + sp.undefine(); + sp.free(); + } + } catch (LibvirtException l) { + + } + throw e; + } + } else { + StoragePoolInfo spi = sp.getInfo(); + if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + sp.create(0); + } + return sp; + } + } + + public void storagePoolRefresh(StoragePool pool) { + try { + synchronized (getStoragePool(pool.getUUIDString())) { + pool.refresh(0); + } + } catch (LibvirtException e) { + + } + } + + private StoragePool createNfsStoragePool(Connect conn, String uuid, + String host, String path) { + String targetPath = _mountPoint + File.separator + uuid; + LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.NETFS, + uuid, uuid, host, path, targetPath); + _storageLayer.mkdir(targetPath); + StoragePool sp = null; + try { + s_logger.debug(spd.toString()); + sp = conn.storagePoolDefineXML(spd.toString(), 0); + sp.create(0); + return sp; + } catch (LibvirtException e) { + s_logger.debug(e.toString()); + if (sp != null) { + try { + sp.undefine(); + sp.free(); + } catch (LibvirtException l) { + s_logger.debug("Failed to define nfs storage pool with: " + + l.toString()); + } + } + return null; + } + } + + private StoragePool CreateSharedStoragePool(Connect conn, String uuid, + String host, String path) { + String mountPoint = path; + if (!_storageLayer.exists(mountPoint)) { + return null; + } + LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR, + uuid, uuid, host, path, path); + StoragePool sp = null; + try { + s_logger.debug(spd.toString()); + sp = conn.storagePoolDefineXML(spd.toString(), 0); + sp.create(0); + + return sp; + } catch (LibvirtException e) { + s_logger.debug(e.toString()); + if (sp != null) { + try { + sp.undefine(); + sp.free(); + } catch (LibvirtException l) { + s_logger.debug("Failed to define shared mount point storage pool with: " + + l.toString()); + } + } + return null; + } + } + + private StoragePool createCLVMStoragePool(Connect conn, String uuid, + String host, String path) { + + String volgroupPath = "/dev/" + path; + String volgroupName = path; + volgroupName = volgroupName.replaceFirst("/", ""); + + LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.LOGICAL, + volgroupName, uuid, host, volgroupPath, volgroupPath); + StoragePool sp = null; + try { + s_logger.debug(spd.toString()); + sp = conn.storagePoolDefineXML(spd.toString(), 0); + sp.create(0); + return sp; + } catch (LibvirtException e) { + s_logger.debug(e.toString()); + if (sp != null) { + try { + sp.undefine(); + sp.free(); + } catch (LibvirtException l) { + s_logger.debug("Failed to define clvm storage pool with: " + + l.toString()); + } + } + return null; + } + + } + + public StorageVol copyVolume(StoragePool destPool, + LibvirtStorageVolumeDef destVol, StorageVol srcVol, int timeout) + throws LibvirtException { + StorageVol vol = destPool.storageVolCreateXML(destVol.toString(), 0); + String srcPath = srcVol.getKey(); + String destPath = vol.getKey(); + Script.runSimpleBashScript("cp " + srcPath + " " + destPath, timeout); + return vol; + } + + public boolean copyVolume(String srcPath, String destPath, + String volumeName, int timeout) throws InternalErrorException { + _storageLayer.mkdirs(destPath); + if (!_storageLayer.exists(srcPath)) { + throw new InternalErrorException("volume:" + srcPath + + " is not exits"); + } + String result = Script.runSimpleBashScript("cp " + srcPath + " " + + destPath + File.separator + volumeName, timeout); + if (result != null) { + return false; + } else { + return true; + } + } + + public LibvirtStoragePoolDef getStoragePoolDef(Connect conn, + StoragePool pool) throws LibvirtException { + String poolDefXML = pool.getXMLDesc(0); + LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); + return parser.parseStoragePoolXML(poolDefXML); + } + + public LibvirtStorageVolumeDef getStorageVolumeDef(Connect conn, + StorageVol vol) throws LibvirtException { + String volDefXML = vol.getXMLDesc(0); + LibvirtStorageVolumeXMLParser parser = new LibvirtStorageVolumeXMLParser(); + return parser.parseStorageVolumeXML(volDefXML); + } + + public StorageVol getVolumeFromURI(Connect conn, String volPath) + throws LibvirtException, URISyntaxException { + int index = volPath.lastIndexOf("/"); + URI volDir = null; + StoragePool sp = null; + StorageVol vol = null; + try { + volDir = new URI(volPath.substring(0, index)); + String volName = volPath.substring(index + 1); + sp = getStoragePoolbyURI(conn, volDir); + vol = sp.storageVolLookupByName(volName); + return vol; + } catch (LibvirtException e) { + s_logger.debug("Faild to get vol path: " + e.toString()); + throw e; + } finally { + try { + if (sp != null) { + sp.free(); + } + } catch (LibvirtException e) { + + } + } + } + + public StoragePool createFileBasedStoragePool(Connect conn, + String localStoragePath, String uuid) { + if (!(_storageLayer.exists(localStoragePath) && _storageLayer + .isDirectory(localStoragePath))) { + return null; + } + + File path = new File(localStoragePath); + if (!(path.canWrite() && path.canRead() && path.canExecute())) { + return null; + } + + StoragePool pool = null; + + try { + pool = conn.storagePoolLookupByUUIDString(uuid); + } catch (LibvirtException e) { + + } + + if (pool == null) { + LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR, + uuid, uuid, null, null, localStoragePath); + try { + pool = conn.storagePoolDefineXML(spd.toString(), 0); + pool.create(0); + } catch (LibvirtException e) { + if (pool != null) { + try { + pool.destroy(); + pool.undefine(); + } catch (LibvirtException e1) { + } + pool = null; + } + throw new CloudRuntimeException(e.toString()); + } + } + + try { + StoragePoolInfo spi = pool.getInfo(); + if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + pool.create(0); + } + + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + + return pool; + } + + private void getStats(LibvirtStoragePool pool) { + Script statsScript = new Script("/bin/bash", s_logger); + statsScript.add("-c"); + statsScript.add("stats=$(df --total " + pool.getLocalPath() + + " |grep total|awk '{print $2,$3}');echo $stats"); + final OutputInterpreter.OneLineParser statsParser = new OutputInterpreter.OneLineParser(); + String result = statsScript.execute(statsParser); + if (result == null) { + String stats = statsParser.getLine(); + if (stats != null && !stats.isEmpty()) { + String sizes[] = stats.trim().split(" "); + if (sizes.length == 2) { + pool.setCapacity(Long.parseLong(sizes[0]) * 1024); + pool.setUsed(Long.parseLong(sizes[1]) * 1024); + } + } + } + } + + @Override + public KVMStoragePool getStoragePool(String uuid) { + StoragePool storage = null; + try { + Connect conn = LibvirtConnection.getConnection(); + storage = conn.storagePoolLookupByUUIDString(uuid); + + if (storage.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + storage.create(0); + } + LibvirtStoragePoolDef spd = getStoragePoolDef(conn, storage); + StoragePoolType type = null; + if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.NETFS + || spd.getPoolType() == LibvirtStoragePoolDef.poolType.DIR) { + type = StoragePoolType.Filesystem; + } + LibvirtStoragePool pool = new LibvirtStoragePool(uuid, + storage.getName(), type, this, storage); + pool.setLocalPath(spd.getTargetPath()); + getStats(pool); + return pool; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + } + + @Override + public KVMPhysicalDisk getPhysicalDisk(String volumeUuid, + KVMStoragePool pool) { + LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; + + try { + StorageVol vol = this.getVolume(libvirtPool.getPool(), volumeUuid); + KVMPhysicalDisk disk; + LibvirtStorageVolumeDef voldef = getStorageVolumeDef(libvirtPool + .getPool().getConnect(), vol); + disk = new KVMPhysicalDisk(vol.getPath(), vol.getName(), pool); + disk.setSize(vol.getInfo().allocation); + disk.setVirtualSize(vol.getInfo().capacity); + if (voldef.getFormat() == null) { + disk.setFormat(pool.getDefaultFormat()); + } else if (voldef.getFormat() == LibvirtStorageVolumeDef.volFormat.QCOW2) { + disk.setFormat(KVMPhysicalDisk.PhysicalDiskFormat.QCOW2); + } else if (voldef.getFormat() == LibvirtStorageVolumeDef.volFormat.RAW) { + disk.setFormat(KVMPhysicalDisk.PhysicalDiskFormat.RAW); + } + return disk; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + + } + + @Override + public KVMStoragePool createStoragePool(String name, String host, + String path, StoragePoolType type) { + StoragePool sp = null; + Connect conn = null; + try { + conn = LibvirtConnection.getConnection(); + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + + try { + sp = conn.storagePoolLookupByUUIDString(name); + if (sp.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + sp.undefine(); + sp = null; + } + } catch (LibvirtException e) { + + } + + if (sp == null) { + if (type == StoragePoolType.NetworkFilesystem) { + sp = createNfsStoragePool(conn, name, host, path); + } else if (type == StoragePoolType.SharedMountPoint + || type == StoragePoolType.Filesystem) { + sp = CreateSharedStoragePool(conn, name, host, path); + } + } + + try { + StoragePoolInfo spi = sp.getInfo(); + if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + sp.create(0); + } + + LibvirtStoragePoolDef spd = getStoragePoolDef(conn, sp); + LibvirtStoragePool pool = new LibvirtStoragePool(name, + sp.getName(), type, this, sp); + pool.setLocalPath(spd.getTargetPath()); + + getStats(pool); + + return pool; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + + } + + @Override + public boolean deleteStoragePool(String uuid) { + Connect conn = null; + try { + conn = LibvirtConnection.getConnection(); + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + + StoragePool sp = null; + + try { + sp = conn.storagePoolLookupByUUIDString(uuid); + } catch (LibvirtException e) { + return true; + } + + try { + sp.destroy(); + sp.undefine(); + sp.free(); + return true; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + } + + @Override + public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, + PhysicalDiskFormat format, long size) { + LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; + StoragePool virtPool = libvirtPool.getPool(); + LibvirtStorageVolumeDef.volFormat libvirtformat = null; + if (format == PhysicalDiskFormat.QCOW2) { + libvirtformat = LibvirtStorageVolumeDef.volFormat.QCOW2; + } else if (format == PhysicalDiskFormat.RAW) { + libvirtformat = LibvirtStorageVolumeDef.volFormat.RAW; + } + + LibvirtStorageVolumeDef volDef = new LibvirtStorageVolumeDef(name, + size, libvirtformat, null, null); + s_logger.debug(volDef.toString()); + try { + StorageVol vol = virtPool.storageVolCreateXML(volDef.toString(), 0); + KVMPhysicalDisk disk = new KVMPhysicalDisk(vol.getPath(), + vol.getName(), pool); + disk.setFormat(format); + disk.setSize(vol.getInfo().allocation); + disk.setVirtualSize(vol.getInfo().capacity); + return disk; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + } + + @Override + public boolean deletePhysicalDisk(String uuid, KVMStoragePool pool) { + LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; + try { + StorageVol vol = this.getVolume(libvirtPool.getPool(), uuid); + vol.delete(0); + vol.free(); + return true; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + } + + @Override + public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, + String name, PhysicalDiskFormat format, long size, + KVMStoragePool destPool) { + KVMPhysicalDisk disk = destPool.createPhysicalDisk(UUID.randomUUID() + .toString(), format, template.getVirtualSize()); + + if (format == PhysicalDiskFormat.QCOW2) { + Script.runSimpleBashScript("qemu-img create -f " + + template.getFormat() + " -b " + template.getPath() + " " + + disk.getPath()); + } else if (format == PhysicalDiskFormat.RAW) { + Script.runSimpleBashScript("qemu-img convert -f " + + template.getFormat() + " -O raw " + template.getPath() + + " " + disk.getPath()); + } + return disk; + } + + @Override + public KVMPhysicalDisk createTemplateFromDisk(KVMPhysicalDisk disk, + String name, PhysicalDiskFormat format, long size, + KVMStoragePool destPool) { + return null; + } + + @Override + public List listPhysicalDisks(String storagePoolUuid, + KVMStoragePool pool) { + LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; + StoragePool virtPool = libvirtPool.getPool(); + List disks = new ArrayList(); + try { + String[] vols = virtPool.listVolumes(); + for (String volName : vols) { + KVMPhysicalDisk disk = this.getPhysicalDisk(volName, pool); + disks.add(disk); + } + return disks; + } catch (LibvirtException e) { + throw new CloudRuntimeException(e.toString()); + } + } + + @Override + public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, + KVMStoragePool destPool) { + KVMPhysicalDisk newDisk = destPool.createPhysicalDisk(name, + disk.getVirtualSize()); + String sourcePath = disk.getPath(); + String destPath = newDisk.getPath(); + + Script.runSimpleBashScript("qemu-img convert -f " + disk.getFormat() + + " -O " + newDisk.getFormat() + " " + sourcePath + " " + + destPath); + return newDisk; + } + + @Override + public KVMStoragePool getStoragePoolByUri(String uri) { + URI storageUri = null; + + try { + storageUri = new URI(uri); + } catch (URISyntaxException e) { + throw new CloudRuntimeException(e.toString()); + } + + String sourcePath = null; + String uuid = null; + String sourceHost = ""; + StoragePoolType protocal = null; + if (storageUri.getScheme().equalsIgnoreCase("nfs")) { + sourcePath = storageUri.getPath(); + sourcePath = sourcePath.replace("//", "/"); + sourceHost = storageUri.getHost(); + uuid = UUID.randomUUID().toString(); + protocal = StoragePoolType.NetworkFilesystem; + } + + return createStoragePool(uuid, sourceHost, sourcePath, protocal); + } + + @Override + public KVMPhysicalDisk getPhysicalDiskFromURI(String uri) { + // TODO Auto-generated method stub + return null; + } + + @Override + public KVMPhysicalDisk createDiskFromSnapshot(KVMPhysicalDisk snapshot, + String snapshotName, String name, KVMStoragePool destPool) { + return null; + } + + @Override + public boolean refresh(KVMStoragePool pool) { + LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; + StoragePool virtPool = libvirtPool.getPool(); + try { + virtPool.refresh(0); + } catch (LibvirtException e) { + return false; + } + return true; + } + + @Override + public boolean deleteStoragePool(KVMStoragePool pool) { + LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; + StoragePool virtPool = libvirtPool.getPool(); + try { + virtPool.destroy(); + virtPool.undefine(); + virtPool.free(); + } catch (LibvirtException e) { + return false; + } + + return true; + } } diff --git a/agent/src/com/cloud/agent/storage/LibvirtStoragePool.java b/agent/src/com/cloud/agent/storage/LibvirtStoragePool.java index de3e0be69d8..d638bb99c59 100644 --- a/agent/src/com/cloud/agent/storage/LibvirtStoragePool.java +++ b/agent/src/com/cloud/agent/storage/LibvirtStoragePool.java @@ -24,135 +24,135 @@ import com.cloud.agent.storage.KVMPhysicalDisk.PhysicalDiskFormat; import com.cloud.storage.Storage.StoragePoolType; public class LibvirtStoragePool implements KVMStoragePool { - protected String uuid; - protected String uri; - protected long capacity; - protected long used; - protected String name; - protected String localPath; - protected PhysicalDiskFormat defaultFormat; - protected StoragePoolType type; - protected StorageAdaptor _storageAdaptor; - protected StoragePool _pool; + protected String uuid; + protected String uri; + protected long capacity; + protected long used; + protected String name; + protected String localPath; + protected PhysicalDiskFormat defaultFormat; + protected StoragePoolType type; + protected StorageAdaptor _storageAdaptor; + protected StoragePool _pool; - public LibvirtStoragePool(String uuid, String name, StoragePoolType type, - StorageAdaptor adaptor, StoragePool pool) { - this.uuid = uuid; - this.name = name; - this.type = type; - this._storageAdaptor = adaptor; - this.capacity = 0; - this.used = 0; - this._pool = pool; + public LibvirtStoragePool(String uuid, String name, StoragePoolType type, + StorageAdaptor adaptor, StoragePool pool) { + this.uuid = uuid; + this.name = name; + this.type = type; + this._storageAdaptor = adaptor; + this.capacity = 0; + this.used = 0; + this._pool = pool; - } + } - public void setCapacity(long capacity) { - this.capacity = capacity; - } + public void setCapacity(long capacity) { + this.capacity = capacity; + } - @Override - public long getCapacity() { - return this.capacity; - } + @Override + public long getCapacity() { + return this.capacity; + } - public void setUsed(long used) { - this.used = used; - } + public void setUsed(long used) { + this.used = used; + } - @Override - public long getUsed() { - return this.used; - } + @Override + public long getUsed() { + return this.used; + } - public StoragePoolType getStoragePoolType() { - return this.type; - } + public StoragePoolType getStoragePoolType() { + return this.type; + } - public String getName() { - return this.name; - } + public String getName() { + return this.name; + } - public String getUuid() { - return this.uuid; - } + public String getUuid() { + return this.uuid; + } - public String uri() { - return this.uri; - } + public String uri() { + return this.uri; + } - @Override - public PhysicalDiskFormat getDefaultFormat() { - return PhysicalDiskFormat.QCOW2; - } + @Override + public PhysicalDiskFormat getDefaultFormat() { + return PhysicalDiskFormat.QCOW2; + } - @Override - public KVMPhysicalDisk createPhysicalDisk(String name, - PhysicalDiskFormat format, long size) { - return this._storageAdaptor - .createPhysicalDisk(name, this, format, size); - } + @Override + public KVMPhysicalDisk createPhysicalDisk(String name, + PhysicalDiskFormat format, long size) { + return this._storageAdaptor + .createPhysicalDisk(name, this, format, size); + } - @Override - public KVMPhysicalDisk createPhysicalDisk(String name, long size) { - return this._storageAdaptor.createPhysicalDisk(name, this, - this.getDefaultFormat(), size); - } + @Override + public KVMPhysicalDisk createPhysicalDisk(String name, long size) { + return this._storageAdaptor.createPhysicalDisk(name, this, + this.getDefaultFormat(), size); + } - @Override - public KVMPhysicalDisk getPhysicalDisk(String volumeUuid) { - return this._storageAdaptor.getPhysicalDisk(volumeUuid, this); - } + @Override + public KVMPhysicalDisk getPhysicalDisk(String volumeUuid) { + return this._storageAdaptor.getPhysicalDisk(volumeUuid, this); + } - @Override - public boolean deletePhysicalDisk(String uuid) { - return this._storageAdaptor.deletePhysicalDisk(uuid, this); - } + @Override + public boolean deletePhysicalDisk(String uuid) { + return this._storageAdaptor.deletePhysicalDisk(uuid, this); + } - @Override - public List listPhysicalDisks() { - return this._storageAdaptor.listPhysicalDisks(this.uuid, this); - } + @Override + public List listPhysicalDisks() { + return this._storageAdaptor.listPhysicalDisks(this.uuid, this); + } - @Override - public boolean refresh() { - return this._storageAdaptor.refresh(this); - } + @Override + public boolean refresh() { + return this._storageAdaptor.refresh(this); + } - @Override - public boolean isExternalSnapshot() { - if (this.type == StoragePoolType.Filesystem) { - return false; - } + @Override + public boolean isExternalSnapshot() { + if (this.type == StoragePoolType.Filesystem) { + return false; + } - return true; - } + return true; + } - @Override - public String getLocalPath() { - return this.localPath; - } + @Override + public String getLocalPath() { + return this.localPath; + } - public void setLocalPath(String localPath) { - this.localPath = localPath; - } + public void setLocalPath(String localPath) { + this.localPath = localPath; + } - @Override - public StoragePoolType getType() { - return this.type; - } + @Override + public StoragePoolType getType() { + return this.type; + } - public StoragePool getPool() { - return this._pool; - } + public StoragePool getPool() { + return this._pool; + } - @Override - public boolean delete() { - return this._storageAdaptor.deleteStoragePool(this); - } + @Override + public boolean delete() { + return this._storageAdaptor.deleteStoragePool(this); + } - @Override - public boolean createFolder(String path) { - return this._storageAdaptor.createFolder(this.uuid, path); - } + @Override + public boolean createFolder(String path) { + return this._storageAdaptor.createFolder(this.uuid, path); + } } diff --git a/agent/src/com/cloud/agent/storage/StorageAdaptor.java b/agent/src/com/cloud/agent/storage/StorageAdaptor.java index b4dde69bd23..9cc5d14d875 100644 --- a/agent/src/com/cloud/agent/storage/StorageAdaptor.java +++ b/agent/src/com/cloud/agent/storage/StorageAdaptor.java @@ -25,46 +25,46 @@ import com.cloud.storage.Storage.StoragePoolType; public interface StorageAdaptor { - public KVMStoragePool getStoragePool(String uuid); + public KVMStoragePool getStoragePool(String uuid); - public KVMPhysicalDisk getPhysicalDisk(String volumeUuid, - KVMStoragePool pool); + public KVMPhysicalDisk getPhysicalDisk(String volumeUuid, + KVMStoragePool pool); - public KVMStoragePool createStoragePool(String name, String host, - String path, StoragePoolType type); + public KVMStoragePool createStoragePool(String name, String host, + String path, StoragePoolType type); - public boolean deleteStoragePool(String uuid); + public boolean deleteStoragePool(String uuid); - public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, - PhysicalDiskFormat format, long size); + public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, + PhysicalDiskFormat format, long size); - public boolean deletePhysicalDisk(String uuid, KVMStoragePool pool); + public boolean deletePhysicalDisk(String uuid, KVMStoragePool pool); - public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, - String name, PhysicalDiskFormat format, long size, - KVMStoragePool destPool); + public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, + String name, PhysicalDiskFormat format, long size, + KVMStoragePool destPool); - public KVMPhysicalDisk createTemplateFromDisk(KVMPhysicalDisk disk, - String name, PhysicalDiskFormat format, long size, - KVMStoragePool destPool); + public KVMPhysicalDisk createTemplateFromDisk(KVMPhysicalDisk disk, + String name, PhysicalDiskFormat format, long size, + KVMStoragePool destPool); - public List listPhysicalDisks(String storagePoolUuid, - KVMStoragePool pool); + public List listPhysicalDisks(String storagePoolUuid, + KVMStoragePool pool); - public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, - KVMStoragePool destPools); + public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, + KVMStoragePool destPools); - public KVMPhysicalDisk createDiskFromSnapshot(KVMPhysicalDisk snapshot, - String snapshotName, String name, KVMStoragePool destPool); + public KVMPhysicalDisk createDiskFromSnapshot(KVMPhysicalDisk snapshot, + String snapshotName, String name, KVMStoragePool destPool); - public KVMStoragePool getStoragePoolByUri(String uri); + public KVMStoragePool getStoragePoolByUri(String uri); - public KVMPhysicalDisk getPhysicalDiskFromURI(String uri); + public KVMPhysicalDisk getPhysicalDiskFromURI(String uri); - public boolean refresh(KVMStoragePool pool); + public boolean refresh(KVMStoragePool pool); - public boolean deleteStoragePool(KVMStoragePool pool); + public boolean deleteStoragePool(KVMStoragePool pool); - public boolean createFolder(String uuid, String path); + public boolean createFolder(String uuid, String path); } diff --git a/agent/src/com/cloud/agent/vmdata/JettyVmDataServer.java b/agent/src/com/cloud/agent/vmdata/JettyVmDataServer.java index 55034cd2bdf..6882b3ea8a0 100644 --- a/agent/src/com/cloud/agent/vmdata/JettyVmDataServer.java +++ b/agent/src/com/cloud/agent/vmdata/JettyVmDataServer.java @@ -66,305 +66,305 @@ import com.cloud.utils.script.Script; */ @Local(value = { VmDataServer.class }) public class JettyVmDataServer implements VmDataServer { - private static final Logger s_logger = Logger - .getLogger(JettyVmDataServer.class); + private static final Logger s_logger = Logger + .getLogger(JettyVmDataServer.class); - public static final String USER_DATA = "user-data"; - public static final String META_DATA = "meta-data"; - protected String _vmDataDir; - protected Server _jetty; - protected String _hostIp; - protected Map _ipVmMap = new HashMap(); - protected StorageLayer _fs = new JavaStorageLayer(); + public static final String USER_DATA = "user-data"; + public static final String META_DATA = "meta-data"; + protected String _vmDataDir; + protected Server _jetty; + protected String _hostIp; + protected Map _ipVmMap = new HashMap(); + protected StorageLayer _fs = new JavaStorageLayer(); - public class VmDataServlet extends HttpServlet { + public class VmDataServlet extends HttpServlet { - private static final long serialVersionUID = -1640031398971742349L; + private static final long serialVersionUID = -1640031398971742349L; - JettyVmDataServer _vmDataServer; - String _dataType; // userdata or meta-data + JettyVmDataServer _vmDataServer; + String _dataType; // userdata or meta-data - public VmDataServlet(JettyVmDataServer dataServer, String dataType) { - this._vmDataServer = dataServer; - this._dataType = dataType; - } + public VmDataServlet(JettyVmDataServer dataServer, String dataType) { + this._vmDataServer = dataServer; + this._dataType = dataType; + } - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - int port = req.getServerPort(); - if (port != 80 && port != 8000) { - resp.sendError(HttpServletResponse.SC_NOT_FOUND, - "Request not understood"); - return; - } - if (_dataType.equalsIgnoreCase(USER_DATA)) { - handleUserData(req, resp); - } else if (_dataType.equalsIgnoreCase(META_DATA)) { - handleMetaData(req, resp); - } - } + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + int port = req.getServerPort(); + if (port != 80 && port != 8000) { + resp.sendError(HttpServletResponse.SC_NOT_FOUND, + "Request not understood"); + return; + } + if (_dataType.equalsIgnoreCase(USER_DATA)) { + handleUserData(req, resp); + } else if (_dataType.equalsIgnoreCase(META_DATA)) { + handleMetaData(req, resp); + } + } - protected void handleUserData(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - String metadataItem = req.getPathInfo(); - String requester = req.getRemoteAddr(); - resp.setContentType("text/html"); - resp.setStatus(HttpServletResponse.SC_OK); - String data = null; - if (metadataItem != null) { - String[] path = metadataItem.split("/"); - if (path.length > 1) { - metadataItem = path[1]; - } - } + protected void handleUserData(HttpServletRequest req, + HttpServletResponse resp) throws ServletException, IOException { + String metadataItem = req.getPathInfo(); + String requester = req.getRemoteAddr(); + resp.setContentType("text/html"); + resp.setStatus(HttpServletResponse.SC_OK); + String data = null; + if (metadataItem != null) { + String[] path = metadataItem.split("/"); + if (path.length > 1) { + metadataItem = path[1]; + } + } - if (metadataItem != null) - data = _vmDataServer.getVmDataItem(requester, metadataItem); + if (metadataItem != null) + data = _vmDataServer.getVmDataItem(requester, metadataItem); - if (data != null) { - resp.getWriter().print(data); - } else { - resp.setStatus(HttpServletResponse.SC_NOT_FOUND); - resp.sendError(HttpServletResponse.SC_NOT_FOUND, - "Request not found"); - } + if (data != null) { + resp.getWriter().print(data); + } else { + resp.setStatus(HttpServletResponse.SC_NOT_FOUND); + resp.sendError(HttpServletResponse.SC_NOT_FOUND, + "Request not found"); + } - } + } - protected void handleMetaData(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - String metadataItem = req.getPathInfo(); - String requester = req.getRemoteAddr(); - resp.setContentType("text/html"); - resp.setStatus(HttpServletResponse.SC_OK); - String metaData = _vmDataServer.getVmDataItem(requester, - metadataItem); - if (metaData != null) { - resp.getWriter().print( - _vmDataServer.getVmDataItem(requester, metadataItem)); - } else { - resp.sendError(HttpServletResponse.SC_NOT_FOUND, - "Request not found"); - } - } + protected void handleMetaData(HttpServletRequest req, + HttpServletResponse resp) throws ServletException, IOException { + String metadataItem = req.getPathInfo(); + String requester = req.getRemoteAddr(); + resp.setContentType("text/html"); + resp.setStatus(HttpServletResponse.SC_OK); + String metaData = _vmDataServer.getVmDataItem(requester, + metadataItem); + if (metaData != null) { + resp.getWriter().print( + _vmDataServer.getVmDataItem(requester, metadataItem)); + } else { + resp.sendError(HttpServletResponse.SC_NOT_FOUND, + "Request not found"); + } + } - } + } - @Override - public boolean configure(String name, Map params) - throws ConfigurationException { - boolean success = true; - try { - int vmDataPort = 80; - int fileservingPort = 8000; - _vmDataDir = (String) params.get("vm.data.dir"); - String port = (String) params.get("vm.data.port"); - if (port != null) { - vmDataPort = Integer.parseInt(port); - } - port = (String) params.get("file.server.port"); - if (port != null) { - fileservingPort = Integer.parseInt(port); - } - _hostIp = (String) params.get("host.ip"); + @Override + public boolean configure(String name, Map params) + throws ConfigurationException { + boolean success = true; + try { + int vmDataPort = 80; + int fileservingPort = 8000; + _vmDataDir = (String) params.get("vm.data.dir"); + String port = (String) params.get("vm.data.port"); + if (port != null) { + vmDataPort = Integer.parseInt(port); + } + port = (String) params.get("file.server.port"); + if (port != null) { + fileservingPort = Integer.parseInt(port); + } + _hostIp = (String) params.get("host.ip"); - if (_vmDataDir == null) { - _vmDataDir = "/var/www/html"; - } - success = _fs.mkdirs(_vmDataDir); - success = success && buildIpVmMap(); - if (success) { - setupJetty(vmDataPort, fileservingPort); - } - } catch (Exception e) { - s_logger.warn("Failed to configure jetty", e); - throw new ConfigurationException("Failed to configure jetty!!"); - } - return success; - } + if (_vmDataDir == null) { + _vmDataDir = "/var/www/html"; + } + success = _fs.mkdirs(_vmDataDir); + success = success && buildIpVmMap(); + if (success) { + setupJetty(vmDataPort, fileservingPort); + } + } catch (Exception e) { + s_logger.warn("Failed to configure jetty", e); + throw new ConfigurationException("Failed to configure jetty!!"); + } + return success; + } - protected boolean buildIpVmMap() { - String[] dirs = _fs.listFiles(_vmDataDir); - for (String dir : dirs) { - String[] path = dir.split("/"); - String vm = path[path.length - 1]; - if (vm.startsWith("i-")) { - String[] dataFiles = _fs.listFiles(dir); - for (String dfile : dataFiles) { - String path2[] = dfile.split("/"); - String ipv4file = path2[path2.length - 1]; - if (ipv4file.equalsIgnoreCase("local-ipv4")) { - try { - BufferedReader input = new BufferedReader( - new FileReader(dfile)); - String line = null; - while ((line = input.readLine()) != null) { - if (NetUtils.isValidIp(line)) { - _ipVmMap.put(line, vm); - s_logger.info("Found ip " + line - + " for vm " + vm); - } else { - s_logger.info("Invalid ip " + line - + " for vm " + vm); - } - } - } catch (FileNotFoundException e) { - s_logger.warn("Failed to find file " + dfile); - } catch (IOException e) { - s_logger.warn("Failed to get ip address of " + vm); - } + protected boolean buildIpVmMap() { + String[] dirs = _fs.listFiles(_vmDataDir); + for (String dir : dirs) { + String[] path = dir.split("/"); + String vm = path[path.length - 1]; + if (vm.startsWith("i-")) { + String[] dataFiles = _fs.listFiles(dir); + for (String dfile : dataFiles) { + String path2[] = dfile.split("/"); + String ipv4file = path2[path2.length - 1]; + if (ipv4file.equalsIgnoreCase("local-ipv4")) { + try { + BufferedReader input = new BufferedReader( + new FileReader(dfile)); + String line = null; + while ((line = input.readLine()) != null) { + if (NetUtils.isValidIp(line)) { + _ipVmMap.put(line, vm); + s_logger.info("Found ip " + line + + " for vm " + vm); + } else { + s_logger.info("Invalid ip " + line + + " for vm " + vm); + } + } + } catch (FileNotFoundException e) { + s_logger.warn("Failed to find file " + dfile); + } catch (IOException e) { + s_logger.warn("Failed to get ip address of " + vm); + } - } - } - } - } - return true; - } + } + } + } + } + return true; + } - public String getVmDataItem(String requester, String dataItem) { - String vmName = _ipVmMap.get(requester); - if (vmName == null) { - return null; - } - String vmDataFile = _vmDataDir + File.separator + vmName - + File.separator + dataItem; - try { - BufferedReader input = new BufferedReader( - new FileReader(vmDataFile)); - StringBuilder result = new StringBuilder(); - String line = null; - while ((line = input.readLine()) != null) { - result.append(line); - } - input.close(); - return result.toString(); - } catch (FileNotFoundException e) { - s_logger.warn("Failed to find requested file " + vmDataFile); - return null; - } catch (IOException e) { - s_logger.warn("Failed to read requested file " + vmDataFile); - return null; - } - } + public String getVmDataItem(String requester, String dataItem) { + String vmName = _ipVmMap.get(requester); + if (vmName == null) { + return null; + } + String vmDataFile = _vmDataDir + File.separator + vmName + + File.separator + dataItem; + try { + BufferedReader input = new BufferedReader( + new FileReader(vmDataFile)); + StringBuilder result = new StringBuilder(); + String line = null; + while ((line = input.readLine()) != null) { + result.append(line); + } + input.close(); + return result.toString(); + } catch (FileNotFoundException e) { + s_logger.warn("Failed to find requested file " + vmDataFile); + return null; + } catch (IOException e) { + s_logger.warn("Failed to read requested file " + vmDataFile); + return null; + } + } - private void setupJetty(int vmDataPort, int fileservingPort) - throws Exception { - _jetty = new Server(); + private void setupJetty(int vmDataPort, int fileservingPort) + throws Exception { + _jetty = new Server(); - SelectChannelConnector connector0 = new SelectChannelConnector(); - connector0.setHost(_hostIp); - connector0.setPort(fileservingPort); - connector0.setMaxIdleTime(30000); - connector0.setRequestBufferSize(8192); + SelectChannelConnector connector0 = new SelectChannelConnector(); + connector0.setHost(_hostIp); + connector0.setPort(fileservingPort); + connector0.setMaxIdleTime(30000); + connector0.setRequestBufferSize(8192); - SelectChannelConnector connector1 = new SelectChannelConnector(); - connector1.setHost(_hostIp); - connector1.setPort(vmDataPort); - connector1.setThreadPool(new QueuedThreadPool(5)); - connector1.setMaxIdleTime(30000); - connector1.setRequestBufferSize(8192); + SelectChannelConnector connector1 = new SelectChannelConnector(); + connector1.setHost(_hostIp); + connector1.setPort(vmDataPort); + connector1.setThreadPool(new QueuedThreadPool(5)); + connector1.setMaxIdleTime(30000); + connector1.setRequestBufferSize(8192); - _jetty.setConnectors(new Connector[] { connector0, connector1 }); + _jetty.setConnectors(new Connector[] { connector0, connector1 }); - Context root = new Context(_jetty, "/latest", Context.SESSIONS); - root.setResourceBase(_vmDataDir); - root.addServlet(new ServletHolder(new VmDataServlet(this, USER_DATA)), - "/*"); + Context root = new Context(_jetty, "/latest", Context.SESSIONS); + root.setResourceBase(_vmDataDir); + root.addServlet(new ServletHolder(new VmDataServlet(this, USER_DATA)), + "/*"); - ResourceHandler resource_handler = new ResourceHandler(); - resource_handler.setResourceBase("/var/lib/images/"); + ResourceHandler resource_handler = new ResourceHandler(); + resource_handler.setResourceBase("/var/lib/images/"); - HandlerList handlers = new HandlerList(); - handlers.setHandlers(new Handler[] { root, resource_handler, - new DefaultHandler() }); - _jetty.setHandler(handlers); + HandlerList handlers = new HandlerList(); + handlers.setHandlers(new Handler[] { root, resource_handler, + new DefaultHandler() }); + _jetty.setHandler(handlers); - _jetty.start(); - // _jetty.join(); - } + _jetty.start(); + // _jetty.join(); + } - @Override - public boolean start() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean start() { + // TODO Auto-generated method stub + return false; + } - @Override - public boolean stop() { - return true; - } + @Override + public boolean stop() { + return true; + } - @Override - public String getName() { - return "JettyVmDataServer"; - } + @Override + public String getName() { + return "JettyVmDataServer"; + } - @Override - public Answer handleVmDataCommand(VmDataCommand cmd) { - String vmDataDir = _vmDataDir + File.separator + cmd.getVmName(); + @Override + public Answer handleVmDataCommand(VmDataCommand cmd) { + String vmDataDir = _vmDataDir + File.separator + cmd.getVmName(); - Script.runSimpleBashScript("rm -rf " + vmDataDir); - _fs.mkdirs(vmDataDir); + Script.runSimpleBashScript("rm -rf " + vmDataDir); + _fs.mkdirs(vmDataDir); - for (String[] item : cmd.getVmData()) { - try { - _fs.create(vmDataDir, item[1]); - String vmDataFile = vmDataDir + File.separator + item[1]; - byte[] data; - if (item[2] != null) { - if (item[1].equals("user-data")) { - data = Base64.decodeBase64(item[2]); - } else { - data = item[2].getBytes(); - } - if (data != null && data.length > 0) { - FileOutputStream writer = new FileOutputStream( - vmDataFile); - writer.write(data); - writer.close(); - } - } - } catch (IOException e) { - s_logger.warn("Failed to write vm data item " + item[1], e); - return new Answer(cmd, false, "Failed to write vm data item " - + item[1]); - } - } - return new Answer(cmd); + for (String[] item : cmd.getVmData()) { + try { + _fs.create(vmDataDir, item[1]); + String vmDataFile = vmDataDir + File.separator + item[1]; + byte[] data; + if (item[2] != null) { + if (item[1].equals("user-data")) { + data = Base64.decodeBase64(item[2]); + } else { + data = item[2].getBytes(); + } + if (data != null && data.length > 0) { + FileOutputStream writer = new FileOutputStream( + vmDataFile); + writer.write(data); + writer.close(); + } + } + } catch (IOException e) { + s_logger.warn("Failed to write vm data item " + item[1], e); + return new Answer(cmd, false, "Failed to write vm data item " + + item[1]); + } + } + return new Answer(cmd); - } + } - @Override - public void handleVmStarted(VirtualMachineTO vm) { - for (NicTO nic : vm.getNics()) { - if (nic.getType() == TrafficType.Guest) { - if (nic.getIp() != null) { - String ipv4File = _vmDataDir + File.separator - + vm.getName() + File.separator + "local-ipv4"; - try { - _fs.create(_vmDataDir + File.separator + vm.getName(), - "local-ipv4"); - BufferedWriter writer = new BufferedWriter( - new FileWriter(ipv4File)); - writer.write(nic.getIp()); - _ipVmMap.put(nic.getIp(), vm.getName()); - writer.close(); - } catch (IOException e) { - s_logger.warn( - "Failed to create or write to local-ipv4 file " - + ipv4File, e); - } + @Override + public void handleVmStarted(VirtualMachineTO vm) { + for (NicTO nic : vm.getNics()) { + if (nic.getType() == TrafficType.Guest) { + if (nic.getIp() != null) { + String ipv4File = _vmDataDir + File.separator + + vm.getName() + File.separator + "local-ipv4"; + try { + _fs.create(_vmDataDir + File.separator + vm.getName(), + "local-ipv4"); + BufferedWriter writer = new BufferedWriter( + new FileWriter(ipv4File)); + writer.write(nic.getIp()); + _ipVmMap.put(nic.getIp(), vm.getName()); + writer.close(); + } catch (IOException e) { + s_logger.warn( + "Failed to create or write to local-ipv4 file " + + ipv4File, e); + } - } + } - } - } - } + } + } + } - @Override - public void handleVmStopped(String vmName) { - String vmDataDir = _vmDataDir + File.separator + vmName; - Script.runSimpleBashScript("rm -rf " + vmDataDir); - } + @Override + public void handleVmStopped(String vmName) { + String vmDataDir = _vmDataDir + File.separator + vmName; + Script.runSimpleBashScript("rm -rf " + vmDataDir); + } } diff --git a/agent/src/com/cloud/agent/vmdata/VmDataServer.java b/agent/src/com/cloud/agent/vmdata/VmDataServer.java index e9d328e2080..2d85b9bd87e 100644 --- a/agent/src/com/cloud/agent/vmdata/VmDataServer.java +++ b/agent/src/com/cloud/agent/vmdata/VmDataServer.java @@ -28,9 +28,9 @@ import com.cloud.utils.component.Manager; */ public interface VmDataServer extends Manager { - public Answer handleVmDataCommand(VmDataCommand cmd); + public Answer handleVmDataCommand(VmDataCommand cmd); - public void handleVmStarted(VirtualMachineTO vm); + public void handleVmStarted(VirtualMachineTO vm); - public void handleVmStopped(String vmName); + public void handleVmStopped(String vmName); } diff --git a/agent/test/com/cloud/agent/TestAgentShell.java b/agent/test/com/cloud/agent/TestAgentShell.java index 7b6016193ce..d7210acbef3 100644 --- a/agent/test/com/cloud/agent/TestAgentShell.java +++ b/agent/test/com/cloud/agent/TestAgentShell.java @@ -31,12 +31,12 @@ public class TestAgentShell extends Log4jEnabledTestCase { File file = null; try { file = File.createTempFile("wget", ".html"); - AgentShell.wget("http://www.google.com/", file); - - if (s_logger.isDebugEnabled()) { - s_logger.debug("file saved to " + file.getAbsolutePath()); - } - + AgentShell.wget("http://www.google.com/", file); + + if (s_logger.isDebugEnabled()) { + s_logger.debug("file saved to " + file.getAbsolutePath()); + } + } catch (final IOException e) { s_logger.warn("Exception while downloading agent update package, ", e); } diff --git a/api/src/com/cloud/agent/api/StartCommand.java b/api/src/com/cloud/agent/api/StartCommand.java index fcd8b360fa0..4d871389836 100644 --- a/api/src/com/cloud/agent/api/StartCommand.java +++ b/api/src/com/cloud/agent/api/StartCommand.java @@ -17,12 +17,14 @@ package com.cloud.agent.api; import com.cloud.agent.api.to.VirtualMachineTO; +import com.cloud.host.Host; /** */ public class StartCommand extends Command { VirtualMachineTO vm; - + String hostIp; + public VirtualMachineTO getVirtualMachine() { return vm; } @@ -34,8 +36,17 @@ public class StartCommand extends Command { protected StartCommand() { } - + public StartCommand(VirtualMachineTO vm) { this.vm = vm; } + + public StartCommand(VirtualMachineTO vm, Host host) { + this.vm = vm; + this.hostIp = host.getPrivateIpAddress(); + } + + public String getHostIp() { + return this.hostIp; + } } diff --git a/api/src/com/cloud/agent/api/to/VirtualMachineTO.java b/api/src/com/cloud/agent/api/to/VirtualMachineTO.java index ec93fc65718..42d91626e35 100644 --- a/api/src/com/cloud/agent/api/to/VirtualMachineTO.java +++ b/api/src/com/cloud/agent/api/to/VirtualMachineTO.java @@ -40,6 +40,7 @@ public class VirtualMachineTO { boolean enableHA; boolean limitCpuUse; String vncPassword; + String vncAddr; Map params; VolumeTO[] disks; @@ -191,6 +192,14 @@ public class VirtualMachineTO { public void setVncPassword(String vncPassword) { this.vncPassword = vncPassword; } + + public String getVncAddr() { + return this.vncAddr; + } + + public void setVncAddr(String vncAddr) { + this.vncAddr = vncAddr; + } public Map getDetails() { return params; diff --git a/api/src/com/cloud/api/ApiConstants.java b/api/src/com/cloud/api/ApiConstants.java index b5e60026086..16c33c5a986 100755 --- a/api/src/com/cloud/api/ApiConstants.java +++ b/api/src/com/cloud/api/ApiConstants.java @@ -358,10 +358,13 @@ public class ApiConstants { public static final String VSM_DEVICE_STATE = "vsmdevicestate"; public static final String ADD_VSM_FLAG = "addvsmflag"; public static final String END_POINT = "endpoint"; - //public static final String REGION_DETAILS = "regiondetails"; public static final String REGION_ID = "regionid"; public static final String IS_PROPAGATE = "ispropagate"; - + public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy"; + public static final String RESOURCE_IDS = "resourceids"; + public static final String RESOURCE_ID = "resourceid"; + public static final String CUSTOMER = "customer"; + public enum HostDetails { all, capacity, events, stats, min; } diff --git a/api/src/com/cloud/api/BaseCmd.java b/api/src/com/cloud/api/BaseCmd.java index afebf2b7363..de9af9bcb21 100755 --- a/api/src/com/cloud/api/BaseCmd.java +++ b/api/src/com/cloud/api/BaseCmd.java @@ -50,6 +50,7 @@ import com.cloud.projects.ProjectService; import com.cloud.region.RegionService; import com.cloud.resource.ResourceService; import com.cloud.server.ManagementService; +import com.cloud.server.TaggedResourceService; import com.cloud.storage.StorageService; import com.cloud.storage.snapshot.SnapshotService; import com.cloud.template.TemplateService; @@ -130,7 +131,8 @@ public abstract class BaseCmd { public static IdentityService _identityService; public static StorageNetworkService _storageNetworkService; public static RegionService _regionService; - + public static TaggedResourceService _taggedResourceService; + static void setComponents(ResponseGenerator generator) { ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name); _mgr = (ManagementService) ComponentLocator.getComponent(ManagementService.Name); @@ -158,6 +160,7 @@ public abstract class BaseCmd { _identityService = locator.getManager(IdentityService.class); _storageNetworkService = locator.getManager(StorageNetworkService.class); _regionService = locator.getManager(RegionService.class); + _taggedResourceService = locator.getManager(TaggedResourceService.class); } public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException; diff --git a/api/src/com/cloud/api/ResponseGenerator.java b/api/src/com/cloud/api/ResponseGenerator.java index 42da0fd2cdf..8bf0464e7a4 100755 --- a/api/src/com/cloud/api/ResponseGenerator.java +++ b/api/src/com/cloud/api/ResponseGenerator.java @@ -57,6 +57,7 @@ import com.cloud.api.response.RegionResponse; import com.cloud.api.response.RemoteAccessVpnResponse; import com.cloud.api.response.ResourceCountResponse; import com.cloud.api.response.ResourceLimitResponse; +import com.cloud.api.response.ResourceTagResponse; import com.cloud.api.response.SecurityGroupResponse; import com.cloud.api.response.ServiceOfferingResponse; import com.cloud.api.response.ServiceResponse; @@ -116,6 +117,7 @@ import com.cloud.org.Cluster; import com.cloud.projects.Project; import com.cloud.projects.ProjectAccount; import com.cloud.projects.ProjectInvitation; +import com.cloud.server.ResourceTag; import com.cloud.storage.Snapshot; import com.cloud.storage.StoragePool; import com.cloud.storage.Swift; @@ -284,4 +286,12 @@ public interface ResponseGenerator { * @return */ Long getIdentiyId(String tableName, String token); + + /** + * @param resourceTag + * @return + */ + ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag); + + } diff --git a/api/src/com/cloud/api/commands/AddClusterCmd.java b/api/src/com/cloud/api/commands/AddClusterCmd.java index 6688dee008d..0ff77e01c51 100755 --- a/api/src/com/cloud/api/commands/AddClusterCmd.java +++ b/api/src/com/cloud/api/commands/AddClusterCmd.java @@ -31,8 +31,10 @@ import com.cloud.api.ServerApiException; import com.cloud.api.response.ClusterResponse; import com.cloud.api.response.ListResponse; import com.cloud.exception.DiscoveryException; +import com.cloud.exception.ResourceInUseException; import com.cloud.org.Cluster; import com.cloud.user.Account; +import com.cloud.utils.IdentityProxy; @Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class) public class AddClusterCmd extends BaseCmd { @@ -166,7 +168,14 @@ public class AddClusterCmd extends BaseCmd { this.setResponseObject(response); } catch (DiscoveryException ex) { s_logger.warn("Exception: ", ex); - throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage()); + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage()); + } catch (ResourceInUseException ex) { + s_logger.warn("Exception: ", ex); + ServerApiException e = new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage()); + for (IdentityProxy proxyObj : ex.getIdProxyList()) { + e.addProxyObject(proxyObj.getTableName(), proxyObj.getValue(), proxyObj.getidFieldName()); + } + throw e; } } } diff --git a/api/src/com/cloud/api/commands/CreateTagsCmd.java b/api/src/com/cloud/api/commands/CreateTagsCmd.java new file mode 100644 index 00000000000..f87ae6e96d8 --- /dev/null +++ b/api/src/com/cloud/api/commands/CreateTagsCmd.java @@ -0,0 +1,136 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http:www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +package com.cloud.api.commands; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import com.cloud.api.ApiConstants; +import com.cloud.api.BaseAsyncCmd; +import com.cloud.api.BaseCmd; +import com.cloud.api.Implementation; +import com.cloud.api.Parameter; +import com.cloud.api.ServerApiException; +import com.cloud.api.response.SuccessResponse; +import com.cloud.event.EventTypes; +import com.cloud.server.ResourceTag; +import com.cloud.server.ResourceTag.TaggedResourceType; + +/** + * @author Alena Prokharchyk + */ + +@Implementation(description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank") +public class CreateTagsCmd extends BaseAsyncCmd{ + public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName()); + + private static final String s_name = "createtagsresponse"; + + // /////////////////////////////////////////////////// + // ////////////// API parameters ///////////////////// + // /////////////////////////////////////////////////// + + @Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, required=true, description = "Map of tags (key/value pairs)") + private Map tag; + + @Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, required=true, description="type of the resource") + private String resourceType; + + @Parameter(name=ApiConstants.RESOURCE_IDS, type=CommandType.LIST, required=true, + collectionType=CommandType.STRING, description="list of resources to create the tags for") + private List resourceIds; + + @Parameter(name=ApiConstants.CUSTOMER, type=CommandType.STRING, description="identifies client specific tag. " + + "When the value is not null, the tag can't be used by cloudStack code internally") + private String customer; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + + public TaggedResourceType getResourceType(){ + return _taggedResourceService.getResourceType(resourceType); + } + + public Map getTags() { + Map tagsMap = null; + if (!tag.isEmpty()) { + tagsMap = new HashMap(); + Collection servicesCollection = tag.values(); + Iterator iter = servicesCollection.iterator(); + while (iter.hasNext()) { + HashMap services = (HashMap) iter.next(); + String key = services.get("key"); + String value = services.get("value"); + tagsMap.put(key, value); + } + } + return tagsMap; + } + + public List getResourceIds() { + return resourceIds; + } + + public String getCustomer() { + return customer; + } + + // /////////////////////////////////////////////////// + // ///////////// API Implementation/////////////////// + // /////////////////////////////////////////////////// + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + //FIXME - validate the owner here + return 1; + } + + @Override + public void execute() { + List tags = _taggedResourceService.createTags(getResourceIds(), getResourceType(), getTags(), getCustomer()); + + if (tags != null && !tags.isEmpty()) { + SuccessResponse response = new SuccessResponse(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create tags"); + } + } + + @Override + public String getEventType() { + return EventTypes.EVENT_TAGS_CREATE; + } + + @Override + public String getEventDescription() { + return "creating tags"; + } +} diff --git a/api/src/com/cloud/api/commands/DeleteTagsCmd.java b/api/src/com/cloud/api/commands/DeleteTagsCmd.java new file mode 100644 index 00000000000..402bdb6bf56 --- /dev/null +++ b/api/src/com/cloud/api/commands/DeleteTagsCmd.java @@ -0,0 +1,128 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http:www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +package com.cloud.api.commands; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import com.cloud.api.ApiConstants; +import com.cloud.api.BaseAsyncCmd; +import com.cloud.api.BaseCmd; +import com.cloud.api.Implementation; +import com.cloud.api.Parameter; +import com.cloud.api.ServerApiException; +import com.cloud.api.response.SuccessResponse; +import com.cloud.event.EventTypes; +import com.cloud.server.ResourceTag; +import com.cloud.server.ResourceTag.TaggedResourceType; + +/** + * @author Alena Prokharchyk + */ + +@Implementation(description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank") +public class DeleteTagsCmd extends BaseAsyncCmd{ + public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName()); + + private static final String s_name = "deleteTagsresponse"; + + // /////////////////////////////////////////////////// + // ////////////// API parameters ///////////////////// + // /////////////////////////////////////////////////// + + @Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "Delete tags matching key/value pairs") + private Map tag; + + @Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, required=true, description="Delete tag by resource type") + private String resourceType; + + @Parameter(name=ApiConstants.RESOURCE_IDS, type=CommandType.LIST, required=true, + collectionType=CommandType.STRING, description="Delete tags for resource id(s)") + private List resourceIds; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + + public TaggedResourceType getResourceType(){ + return _taggedResourceService.getResourceType(resourceType); + } + + public Map getTags() { + Map tagsMap = null; + if (tag != null && !tag.isEmpty()) { + tagsMap = new HashMap(); + Collection servicesCollection = tag.values(); + Iterator iter = servicesCollection.iterator(); + while (iter.hasNext()) { + HashMap services = (HashMap) iter.next(); + String key = services.get("key"); + String value = services.get("value"); + tagsMap.put(key, value); + } + } + return tagsMap; + } + + public List getResourceIds() { + return resourceIds; + } + + // /////////////////////////////////////////////////// + // ///////////// API Implementation/////////////////// + // /////////////////////////////////////////////////// + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + //FIXME - validate the owner here + return 1; + } + + @Override + public void execute() { + boolean success = _taggedResourceService.deleteTags(getResourceIds(), getResourceType(), getTags()); + + if (success) { + SuccessResponse response = new SuccessResponse(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete tags"); + } + } + + @Override + public String getEventType() { + return EventTypes.EVENT_TAGS_DELETE; + } + + @Override + public String getEventDescription() { + return "Deleting tags"; + } +} diff --git a/api/src/com/cloud/api/commands/DeployVMCmd.java b/api/src/com/cloud/api/commands/DeployVMCmd.java index 4949cf0ec38..9e2bc24df8f 100644 --- a/api/src/com/cloud/api/commands/DeployVMCmd.java +++ b/api/src/com/cloud/api/commands/DeployVMCmd.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -252,9 +253,9 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { if ((networkIds != null || ipAddress != null) && ipToNetworkList != null) { throw new InvalidParameterValueException("NetworkIds and ipAddress can't be specified along with ipToNetworkMap parameter"); } - Map ipToNetworkMap = null; + LinkedHashMap ipToNetworkMap = null; if (ipToNetworkList != null && !ipToNetworkList.isEmpty()) { - ipToNetworkMap = new HashMap(); + ipToNetworkMap = new LinkedHashMap(); Collection ipsCollection = ipToNetworkList.values(); Iterator iter = ipsCollection.iterator(); while (iter.hasNext()) { diff --git a/api/src/com/cloud/api/commands/ListNetworksCmd.java b/api/src/com/cloud/api/commands/ListNetworksCmd.java index a92feaa2067..8f665b90776 100644 --- a/api/src/com/cloud/api/commands/ListNetworksCmd.java +++ b/api/src/com/cloud/api/commands/ListNetworksCmd.java @@ -63,14 +63,17 @@ public class ListNetworksCmd extends BaseListProjectAndAccountResourcesCmd { @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="list networks by physical network id") private Long physicalNetworkId; - @Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, collectionType=CommandType.STRING, description="list network offerings supporting certain services") + @Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, collectionType=CommandType.STRING, description="list networks supporting certain services") private List supportedServices; - @Parameter(name=ApiConstants.RESTART_REQUIRED, type=CommandType.BOOLEAN, description="list network offerings by restartRequired option") + @Parameter(name=ApiConstants.RESTART_REQUIRED, type=CommandType.BOOLEAN, description="list networks by restartRequired option") private Boolean restartRequired; @Parameter(name=ApiConstants.SPECIFY_IP_RANGES, type=CommandType.BOOLEAN, description="true if need to list only networks which support specifying ip ranges") private Boolean specifyIpRanges; + + @Parameter(name=ApiConstants.CAN_USE_FOR_DEPLOY, type=CommandType.BOOLEAN, description="list networks available for vm deployment") + private Boolean canUseForDeploy; ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// @@ -115,8 +118,12 @@ public class ListNetworksCmd extends BaseListProjectAndAccountResourcesCmd { public Boolean getSpecifyIpRanges() { return specifyIpRanges; } + + public Boolean canUseForDeploy() { + return canUseForDeploy; + } - ///////////////////////////////////////////////////// + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override diff --git a/api/src/com/cloud/api/commands/ListTagsCmd.java b/api/src/com/cloud/api/commands/ListTagsCmd.java new file mode 100644 index 00000000000..5e7acb5071d --- /dev/null +++ b/api/src/com/cloud/api/commands/ListTagsCmd.java @@ -0,0 +1,99 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http:www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +package com.cloud.api.commands; + +import java.util.ArrayList; +import java.util.List; + +import com.cloud.api.ApiConstants; +import com.cloud.api.BaseListProjectAndAccountResourcesCmd; +import com.cloud.api.Implementation; +import com.cloud.api.Parameter; +import com.cloud.api.response.ListResponse; +import com.cloud.api.response.ResourceTagResponse; +import com.cloud.server.ResourceTag; + +/** + * @author Alena Prokharchyk + */ + +@Implementation(description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "Burbank") +public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{ + private static final String s_name = "listtagsresponse"; + + @Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, description="list by resource type") + private String resourceType; + + @Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.STRING, description="list by resource id") + private String resourceId; + + @Parameter(name=ApiConstants.KEY, type=CommandType.STRING, description="list by key") + private String key; + + @Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, description="list by value") + private String value; + + @Parameter(name=ApiConstants.CUSTOMER, type=CommandType.STRING, description="list by customer name") + private String customer; + + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() { + + List tags = _taggedResourceService.listTags(this); + ListResponse response = new ListResponse(); + List tagResponses = new ArrayList(); + for (ResourceTag tag : tags) { + ResourceTagResponse tagResponse = _responseGenerator.createResourceTagResponse(tag); + tagResponses.add(tagResponse); + } + response.setResponses(tagResponses); + + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } + + public String getResourceType() { + return resourceType; + } + + public String getResourceId() { + return resourceId; + } + + public String getKey() { + return key; + } + + public String getValue() { + return value; + } + + @Override + public String getCommandName() { + return s_name; + } + + public String getCustomer() { + return customer; + } +} diff --git a/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java b/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java index 18e506c42b5..a36844aeb3b 100644 --- a/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java +++ b/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java @@ -14,23 +14,6 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -/** - * Copyright (C) 2012 Citrix Systems, Inc. All rights reserved. - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ package com.cloud.api.commands; import org.apache.log4j.Logger; diff --git a/api/src/com/cloud/api/response/NetworkResponse.java b/api/src/com/cloud/api/response/NetworkResponse.java index a8b2e5f5099..4c16240ff8d 100644 --- a/api/src/com/cloud/api/response/NetworkResponse.java +++ b/api/src/com/cloud/api/response/NetworkResponse.java @@ -131,6 +131,9 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes @SerializedName(ApiConstants.SPECIFY_IP_RANGES) @Param(description="true if network supports specifying ip ranges, false otherwise") private Boolean specifyIpRanges; + @SerializedName(ApiConstants.CAN_USE_FOR_DEPLOY) @Param(description="list networks available for vm deployment") + private Boolean canUseForDeploy; + public void setId(Long id) { this.id.setValue(id); } @@ -272,4 +275,8 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes public void setSpecifyIpRanges(Boolean specifyIpRanges) { this.specifyIpRanges = specifyIpRanges; } + + public void setCanUseForDeploy(Boolean canUseForDeploy) { + this.canUseForDeploy = canUseForDeploy; + } } diff --git a/api/src/com/cloud/api/response/ResourceTagResponse.java b/api/src/com/cloud/api/response/ResourceTagResponse.java new file mode 100644 index 00000000000..2c5fd9e6a60 --- /dev/null +++ b/api/src/com/cloud/api/response/ResourceTagResponse.java @@ -0,0 +1,104 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.response; + +import com.cloud.api.ApiConstants; +import com.cloud.serializer.Param; +import com.cloud.utils.IdentityProxy; +import com.google.gson.annotations.SerializedName; + +/** + * @author Alena Prokharchyk + */ + +@SuppressWarnings("unused") +public class ResourceTagResponse extends BaseResponse implements ControlledEntityResponse{ + @SerializedName(ApiConstants.KEY) @Param(description="tag key name") + private String key; + + @SerializedName(ApiConstants.VALUE) @Param(description="tag value") + private String value; + + @SerializedName(ApiConstants.RESOURCE_TYPE) @Param(description="resource type") + private String resourceType; + + @SerializedName(ApiConstants.RESOURCE_ID) @Param(description="id of the resource") + private String id; + + @SerializedName(ApiConstants.ACCOUNT) + @Param(description = "the account associated with the tag") + private String accountName; + + @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id the tag belongs to") + private IdentityProxy projectId = new IdentityProxy("projects"); + + @SerializedName(ApiConstants.PROJECT) @Param(description="the project name where tag belongs to") + private String projectName; + + @SerializedName(ApiConstants.DOMAIN_ID) + @Param(description = "the ID of the domain associated with the tag") + private IdentityProxy domainId = new IdentityProxy("domain"); + + @SerializedName(ApiConstants.DOMAIN) + @Param(description = "the domain associated with the tag") + private String domainName; + + @SerializedName(ApiConstants.CUSTOMER) @Param(description="customer associated with the tag") + private String customer; + + public void setKey(String key) { + this.key = key; + } + + public void setValue(String value) { + this.value = value; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public void setId(String id) { + this.id = id; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public void setDomainId(Long domainId) { + this.domainId.setValue(domainId); + } + + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + @Override + public void setProjectId(Long projectId) { + this.projectId.setValue(projectId); + } + + @Override + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public void setCustomer(String customer) { + this.customer = customer; + } +} diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index 424ddc90a23..c42db5d5759 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -259,4 +259,9 @@ public class EventTypes { public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_ADD = "PHYSICAL.FIREWALL.ADD"; public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE = "PHYSICAL.FIREWALL.DELETE"; public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE = "PHYSICAL.FIREWALL.CONFIGURE"; + + // tag related events + public static final String EVENT_TAGS_CREATE = "CREATE_TAGS"; + public static final String EVENT_TAGS_DELETE = "DELETE_TAGS"; + } diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java index 99f8014e6a6..d7e40a977c6 100755 --- a/api/src/com/cloud/network/NetworkService.java +++ b/api/src/com/cloud/network/NetworkService.java @@ -134,4 +134,10 @@ public interface NetworkService { List getIsolatedNetworksWithSourceNATOwnedByAccountInZone(long zoneId, Account owner); + /** + * @param network + * @return + */ + boolean canUseForDeploy(Network network); + } diff --git a/api/src/com/cloud/resource/ResourceService.java b/api/src/com/cloud/resource/ResourceService.java index d971a407e05..10654539bb6 100755 --- a/api/src/com/cloud/resource/ResourceService.java +++ b/api/src/com/cloud/resource/ResourceService.java @@ -31,6 +31,7 @@ import com.cloud.api.commands.UpdateHostCmd; import com.cloud.api.commands.UpdateHostPasswordCmd; import com.cloud.exception.DiscoveryException; import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceInUseException; import com.cloud.host.Host; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.org.Cluster; @@ -61,7 +62,7 @@ public interface ResourceService { * @throws IllegalArgumentException * @throws DiscoveryException */ - List discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException; + List discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException, ResourceInUseException; boolean deleteCluster(DeleteClusterCmd cmd); diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java new file mode 100644 index 00000000000..e11320e4a02 --- /dev/null +++ b/api/src/com/cloud/server/ResourceTag.java @@ -0,0 +1,67 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.server; + +import com.cloud.acl.ControlledEntity; + +public interface ResourceTag extends ControlledEntity{ + + public enum TaggedResourceType { + UserVm, + Template, + ISO, + Volume, + Snapshot, + Network, + LoadBalancer, + PortForwardingRule, + FirewallRule, + SecurityGroup, + PublicIpAddress + } + + /** + * @return + */ + long getId(); + + /** + * @return + */ + String getKey(); + + /** + * @return + */ + String getValue(); + + /** + * @return + */ + long getResourceId(); + + /** + * @return + */ + TaggedResourceType getResourceType(); + + /** + * @return + */ + String getCustomer(); + +} diff --git a/api/src/com/cloud/server/TaggedResourceService.java b/api/src/com/cloud/server/TaggedResourceService.java new file mode 100644 index 00000000000..e57b884f903 --- /dev/null +++ b/api/src/com/cloud/server/TaggedResourceService.java @@ -0,0 +1,63 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License.package com.cloud.server; + +package com.cloud.server; + + +import java.util.List; +import java.util.Map; + +import com.cloud.api.commands.ListTagsCmd; +import com.cloud.server.ResourceTag.TaggedResourceType; + +/** + * @author Alena Prokharchyk + */ +public interface TaggedResourceService { + + TaggedResourceType getResourceType (String resourceTypeStr); + + /** + * @param resourceIds TODO + * @param resourceType + * @param tags + * @param customer TODO + * @return + */ + List createTags(List resourceIds, TaggedResourceType resourceType, Map tags, String customer); + + /** + * @param resourceId + * @param resourceType + * @return + */ + String getUuid(String resourceId, TaggedResourceType resourceType); + + /** + * @param listTagsCmd + * @return + */ + List listTags(ListTagsCmd listTagsCmd); + + /** + * @param resourceIds + * @param resourceType + * @param tags + * @return + */ + boolean deleteTags(List resourceIds, TaggedResourceType resourceType, Map tags); +} diff --git a/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql b/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql index 9d6a650b09e..44019f1315b 100644 --- a/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql +++ b/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; -- This file (and cloudbridge_policy_alter.sql) can be applied to an existing cloudbridge diff --git a/awsapi-setup/db/mysql/cloudbridge_db.sql b/awsapi-setup/db/mysql/cloudbridge_db.sql index 04ea41a75b9..952a34d9fb8 100644 --- a/awsapi-setup/db/mysql/cloudbridge_db.sql +++ b/awsapi-setup/db/mysql/cloudbridge_db.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI'; DROP DATABASE IF EXISTS cloudbridge; diff --git a/awsapi-setup/db/mysql/cloudbridge_index.sql b/awsapi-setup/db/mysql/cloudbridge_index.sql index d00e5d87acb..e099b658a4d 100644 --- a/awsapi-setup/db/mysql/cloudbridge_index.sql +++ b/awsapi-setup/db/mysql/cloudbridge_index.sql @@ -1,47 +1,64 @@ -USE cloudbridge; - -ALTER TABLE shost ADD UNIQUE shost_uq_host(Host, HostType, ExportRoot); -ALTER TABLE shost ADD CONSTRAINT FOREIGN KEY shost_fk_mhost_id(MHostID) REFERENCES mhost(ID); -ALTER TABLE shost ADD INDEX shost_idx_mhost_id(MHostID); - -ALTER TABLE sbucket ADD UNIQUE sbucket_uq_name(Name); -ALTER TABLE sbucket ADD CONSTRAINT FOREIGN KEY sbucket_fk_shost_id(SHostID) REFERENCES shost(ID); -ALTER TABLE sbucket ADD INDEX sbucket_idx_shost_id(SHostID); -ALTER TABLE sbucket ADD INDEX sbucket_idx_owner_cid(OwnerCanonicalID); -ALTER TABLE sbucket ADD INDEX sbucket_idx_create_time(CreateTime); - -ALTER TABLE sobject ADD CONSTRAINT FOREIGN KEY sobject_fk_sbuckt_id(SBucketID) REFERENCES sbucket(ID) ON DELETE CASCADE; -ALTER TABLE sobject ADD INDEX sobject_idx_bucket_id(SBucketID); -ALTER TABLE sobject ADD INDEX sobject_idx_owner_cid(OwnerCanonicalID); -ALTER TABLE sobject ADD UNIQUE sobject_uq_sbucket_id_name_key(SBucketID, NameKey); -ALTER TABLE sobject ADD INDEX sobject_idx_create_time(CreateTime); - -ALTER TABLE sobject_item ADD CONSTRAINT FOREIGN KEY sobject_item_fk_object_id(SObjectID) REFERENCES sobject(ID) ON DELETE CASCADE; -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_object_id(SObjectID); -ALTER TABLE sobject_item ADD UNIQUE sobject_item_uq_sobject_id_version(SObjectID, Version); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_create_time(CreateTime); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_modify_time(LastModifiedTime); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_access_time(LastAccessTime); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_stored_size(StoredSize); - -ALTER TABLE meta ADD UNIQUE meta_uq_target_name(Target, TargetID, Name); -ALTER TABLE meta ADD INDEX meta_idx_target(Target, TargetID); - -ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings1(AccessKey); -ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings2(CertUniqueId); -ALTER TABLE usercredentials ADD INDEX usercredentials_idx_access(AccessKey); -ALTER TABLE usercredentials ADD INDEX usercredentials_idx_cert(CertUniqueId); - -ALTER TABLE acl ADD INDEX acl_idx_target(Target, TargetID); -ALTER TABLE acl ADD INDEX acl_idx_modify_time(LastModifiedTime); - -ALTER TABLE mhost ADD UNIQUE mhost_uq_host(Host); -ALTER TABLE mhost ADD INDEX mhost_idx_mhost_key(MHostKey); -ALTER TABLE mhost ADD INDEX mhost_idx_heartbeat_time(LastHeartbeatTime); - -ALTER TABLE mhost_mount ADD UNIQUE mhost_mnt_uq_mhost_shost(MHostID, SHostID); -ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_mhost_id(MHostID) REFERENCES mhost(ID) ON DELETE CASCADE; -ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_shost_id(SHostID) REFERENCES shost(ID) ON DELETE CASCADE; -ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mhost_id(MHostID); -ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_shost_id(SHostID); -ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mount_time(LastMountTime); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +USE cloudbridge; + +ALTER TABLE shost ADD UNIQUE shost_uq_host(Host, HostType, ExportRoot); +ALTER TABLE shost ADD CONSTRAINT FOREIGN KEY shost_fk_mhost_id(MHostID) REFERENCES mhost(ID); +ALTER TABLE shost ADD INDEX shost_idx_mhost_id(MHostID); + +ALTER TABLE sbucket ADD UNIQUE sbucket_uq_name(Name); +ALTER TABLE sbucket ADD CONSTRAINT FOREIGN KEY sbucket_fk_shost_id(SHostID) REFERENCES shost(ID); +ALTER TABLE sbucket ADD INDEX sbucket_idx_shost_id(SHostID); +ALTER TABLE sbucket ADD INDEX sbucket_idx_owner_cid(OwnerCanonicalID); +ALTER TABLE sbucket ADD INDEX sbucket_idx_create_time(CreateTime); + +ALTER TABLE sobject ADD CONSTRAINT FOREIGN KEY sobject_fk_sbuckt_id(SBucketID) REFERENCES sbucket(ID) ON DELETE CASCADE; +ALTER TABLE sobject ADD INDEX sobject_idx_bucket_id(SBucketID); +ALTER TABLE sobject ADD INDEX sobject_idx_owner_cid(OwnerCanonicalID); +ALTER TABLE sobject ADD UNIQUE sobject_uq_sbucket_id_name_key(SBucketID, NameKey); +ALTER TABLE sobject ADD INDEX sobject_idx_create_time(CreateTime); + +ALTER TABLE sobject_item ADD CONSTRAINT FOREIGN KEY sobject_item_fk_object_id(SObjectID) REFERENCES sobject(ID) ON DELETE CASCADE; +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_object_id(SObjectID); +ALTER TABLE sobject_item ADD UNIQUE sobject_item_uq_sobject_id_version(SObjectID, Version); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_create_time(CreateTime); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_modify_time(LastModifiedTime); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_access_time(LastAccessTime); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_stored_size(StoredSize); + +ALTER TABLE meta ADD UNIQUE meta_uq_target_name(Target, TargetID, Name); +ALTER TABLE meta ADD INDEX meta_idx_target(Target, TargetID); + +ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings1(AccessKey); +ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings2(CertUniqueId); +ALTER TABLE usercredentials ADD INDEX usercredentials_idx_access(AccessKey); +ALTER TABLE usercredentials ADD INDEX usercredentials_idx_cert(CertUniqueId); + +ALTER TABLE acl ADD INDEX acl_idx_target(Target, TargetID); +ALTER TABLE acl ADD INDEX acl_idx_modify_time(LastModifiedTime); + +ALTER TABLE mhost ADD UNIQUE mhost_uq_host(Host); +ALTER TABLE mhost ADD INDEX mhost_idx_mhost_key(MHostKey); +ALTER TABLE mhost ADD INDEX mhost_idx_heartbeat_time(LastHeartbeatTime); + +ALTER TABLE mhost_mount ADD UNIQUE mhost_mnt_uq_mhost_shost(MHostID, SHostID); +ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_mhost_id(MHostID) REFERENCES mhost(ID) ON DELETE CASCADE; +ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_shost_id(SHostID) REFERENCES shost(ID) ON DELETE CASCADE; +ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mhost_id(MHostID); +ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_shost_id(SHostID); +ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mount_time(LastMountTime); diff --git a/awsapi-setup/db/mysql/cloudbridge_multipart.sql b/awsapi-setup/db/mysql/cloudbridge_multipart.sql index 27456c4f41b..e30c0ce4dee 100644 --- a/awsapi-setup/db/mysql/cloudbridge_multipart.sql +++ b/awsapi-setup/db/mysql/cloudbridge_multipart.sql @@ -1,3 +1,20 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + USE cloudbridge; -- This file can be applied to an existing cloudbridge database. It is used diff --git a/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql b/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql index 203bf3aa9c8..2614aaff459 100644 --- a/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql +++ b/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; ALTER TABLE multipart_meta ADD CONSTRAINT FOREIGN KEY meta_uploads_id(UploadID) REFERENCES multipart_uploads(ID) ON DELETE CASCADE; diff --git a/awsapi-setup/db/mysql/cloudbridge_offering.sql b/awsapi-setup/db/mysql/cloudbridge_offering.sql index 064fd93fe7f..f21af5aff32 100644 --- a/awsapi-setup/db/mysql/cloudbridge_offering.sql +++ b/awsapi-setup/db/mysql/cloudbridge_offering.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; -- This file (and cloudbridge_offering_alter.sql) can be applied to an existing cloudbridge diff --git a/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql b/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql index c44df79f479..bffb34d1d24 100644 --- a/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql +++ b/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; ALTER TABLE offering_bundle ADD UNIQUE one_offering (AmazonEC2Offering); diff --git a/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql b/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql index 311a86528e7..53ab40bae39 100644 --- a/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql +++ b/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; ALTER TABLE bucket_policies ADD UNIQUE one_policy_per_bucket(BucketName); diff --git a/awsapi-setup/db/mysql/cloudbridge_schema.sql b/awsapi-setup/db/mysql/cloudbridge_schema.sql index f4b21a04376..de22f113086 100644 --- a/awsapi-setup/db/mysql/cloudbridge_schema.sql +++ b/awsapi-setup/db/mysql/cloudbridge_schema.sql @@ -1,144 +1,162 @@ -USE cloudbridge; - -SET foreign_key_checks = 0; - -DROP TABLE IF EXISTS shost; -DROP TABLE IF EXISTS mhost; -DROP TABLE IF EXISTS mhost_mount; -DROP TABLE IF EXISTS sbucket; -DROP TABLE IF EXISTS sobject; -DROP TABLE IF EXISTS sobject_item; -DROP TABLE IF EXISTS meta; -DROP TABLE IF EXISTS acl; -DROP TABLE IF EXISTS usercredentials; - --- storage host -CREATE TABLE shost ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Host VARCHAR(128) NOT NULL, - HostType INT NOT NULL DEFAULT 0, -- 0 : local, 1 : nfs - ExportRoot VARCHAR(128) NOT NULL, - - MHostID BIGINT, -- when host type is local, MHostID points to its owner management host - - UserOnHost VARCHAR(64), - UserPassword VARCHAR(128), - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- management host -CREATE TABLE mhost ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - MHostKey VARCHAR(128) NOT NULL, -- host key could be derived from MAC address or named configuration value - Host VARCHAR(128), -- public host address for redirecting request from/to - - Version VARCHAR(64), - LastHeartbeatTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE mhost_mount ( - ID BIGINT NOT NULL AUTO_INCREMENT, - MHostID BIGINT NOT NULL, - SHostID BIGINT NOT NULL, - - MountPath VARCHAR(256), -- local mount path - LastMountTime DATETIME, -- null : unmounted, otherwise the mount location - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sbucket ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Name VARCHAR(64) NOT NULL, - OwnerCanonicalID VARCHAR(150) NOT NULL, - - SHostID BIGINT, - - CreateTime DATETIME, - - VersioningStatus INT NOT NULL DEFAULT 0, -- 0 : initial not set, 1 : enabled, 2 : suspended - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sobject ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - SBucketID BIGINT NOT NULL, - NameKey VARCHAR(255) NOT NULL, - - OwnerCanonicalID VARCHAR(150) NOT NULL, - NextSequence INT NOT NULL DEFAULT 1, - DeletionMark VARCHAR (150), - - CreateTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sobject_item ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - SObjectID BIGINT NOT NULL, - Version VARCHAR(64), - - MD5 VARCHAR(128), - StoredPath VARCHAR(256), -- relative to mount point of the root - StoredSize BIGINT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - LastModifiedTime DATETIME, - LastAccessTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE meta ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Target VARCHAR(64) NOT NULL, - TargetID BIGINT NOT NULL, - - Name VARCHAR(64) NOT NULL, - Value VARCHAR(256), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE acl ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Target VARCHAR(64) NOT NULL, - TargetID BIGINT NOT NULL, - - GranteeType INT NOT NULL DEFAULT 0, -- 0 : Cloud service user, 1 : Cloud user community, 2: Public user community - GranteeCanonicalID VARCHAR(150), -- make it big enought to hold a Cloud API access key - - Permission INT NOT NULL DEFAULT 0, -- 0 : no permission, 1 : read, 2 : write, 4 : read_acl, 8 : write_acl - GrantOrder INT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - LastModifiedTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- each account has to have a separate --- each account has to have a separate mappings -CREATE TABLE usercredentials ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - AccessKey VARCHAR(150) NOT NULL, - SecretKey VARCHAR(150) NOT NULL, - CertUniqueId VARCHAR(200), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -SET foreign_key_checks = 1; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +USE cloudbridge; + +SET foreign_key_checks = 0; + +DROP TABLE IF EXISTS shost; +DROP TABLE IF EXISTS mhost; +DROP TABLE IF EXISTS mhost_mount; +DROP TABLE IF EXISTS sbucket; +DROP TABLE IF EXISTS sobject; +DROP TABLE IF EXISTS sobject_item; +DROP TABLE IF EXISTS meta; +DROP TABLE IF EXISTS acl; +DROP TABLE IF EXISTS usercredentials; + +-- storage host +CREATE TABLE shost ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Host VARCHAR(128) NOT NULL, + HostType INT NOT NULL DEFAULT 0, -- 0 : local, 1 : nfs + ExportRoot VARCHAR(128) NOT NULL, + + MHostID BIGINT, -- when host type is local, MHostID points to its owner management host + + UserOnHost VARCHAR(64), + UserPassword VARCHAR(128), + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- management host +CREATE TABLE mhost ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + MHostKey VARCHAR(128) NOT NULL, -- host key could be derived from MAC address or named configuration value + Host VARCHAR(128), -- public host address for redirecting request from/to + + Version VARCHAR(64), + LastHeartbeatTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE mhost_mount ( + ID BIGINT NOT NULL AUTO_INCREMENT, + MHostID BIGINT NOT NULL, + SHostID BIGINT NOT NULL, + + MountPath VARCHAR(256), -- local mount path + LastMountTime DATETIME, -- null : unmounted, otherwise the mount location + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE sbucket ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Name VARCHAR(64) NOT NULL, + OwnerCanonicalID VARCHAR(150) NOT NULL, + + SHostID BIGINT, + + CreateTime DATETIME, + + VersioningStatus INT NOT NULL DEFAULT 0, -- 0 : initial not set, 1 : enabled, 2 : suspended + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE sobject ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + SBucketID BIGINT NOT NULL, + NameKey VARCHAR(255) NOT NULL, + + OwnerCanonicalID VARCHAR(150) NOT NULL, + NextSequence INT NOT NULL DEFAULT 1, + DeletionMark VARCHAR (150), + + CreateTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE sobject_item ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + SObjectID BIGINT NOT NULL, + Version VARCHAR(64), + + MD5 VARCHAR(128), + StoredPath VARCHAR(256), -- relative to mount point of the root + StoredSize BIGINT NOT NULL DEFAULT 0, + + CreateTime DATETIME, + LastModifiedTime DATETIME, + LastAccessTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE meta ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Target VARCHAR(64) NOT NULL, + TargetID BIGINT NOT NULL, + + Name VARCHAR(64) NOT NULL, + Value VARCHAR(256), + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE acl ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Target VARCHAR(64) NOT NULL, + TargetID BIGINT NOT NULL, + + GranteeType INT NOT NULL DEFAULT 0, -- 0 : Cloud service user, 1 : Cloud user community, 2: Public user community + GranteeCanonicalID VARCHAR(150), -- make it big enought to hold a Cloud API access key + + Permission INT NOT NULL DEFAULT 0, -- 0 : no permission, 1 : read, 2 : write, 4 : read_acl, 8 : write_acl + GrantOrder INT NOT NULL DEFAULT 0, + + CreateTime DATETIME, + LastModifiedTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- each account has to have a separate +-- each account has to have a separate mappings +CREATE TABLE usercredentials ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + AccessKey VARCHAR(150) NOT NULL, + SecretKey VARCHAR(150) NOT NULL, + CertUniqueId VARCHAR(200), + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +SET foreign_key_checks = 1; + diff --git a/awsapi-setup/db/mysql/deploy-db-bridge.sh b/awsapi-setup/db/mysql/deploy-db-bridge.sh index abaa19b9a0a..2e8ceee24eb 100644 --- a/awsapi-setup/db/mysql/deploy-db-bridge.sh +++ b/awsapi-setup/db/mysql/deploy-db-bridge.sh @@ -1,7 +1,20 @@ #!/usr/bin/env bash -# deploy-db-bridge.sh -- deploys the cloudbridge database configuration. -# -# set -x +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. if [ ! -f cloudbridge_db.sql ]; then printf "Error: Unable to find cloudbridge_db.sql\n" diff --git a/awsapi-setup/init/debian/cloud-bridge b/awsapi-setup/init/debian/cloud-bridge index 8fb0fbf659c..c1bf90b4d93 100644 --- a/awsapi-setup/init/debian/cloud-bridge +++ b/awsapi-setup/init/debian/cloud-bridge @@ -1,4 +1,20 @@ #!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # # /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine # diff --git a/awsapi-setup/init/rpm/cloud-bridge b/awsapi-setup/init/rpm/cloud-bridge index ee9bd5138ee..444b771cb4b 100644 --- a/awsapi-setup/init/rpm/cloud-bridge +++ b/awsapi-setup/init/rpm/cloud-bridge @@ -1,5 +1,22 @@ #!/bin/bash # +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# # tomcat6 This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 diff --git a/awsapi-setup/setup/cloud-setup-bridge b/awsapi-setup/setup/cloud-setup-bridge index ea3fa1faf22..d25072da1eb 100644 --- a/awsapi-setup/setup/cloud-setup-bridge +++ b/awsapi-setup/setup/cloud-setup-bridge @@ -1,5 +1,22 @@ #!/bin/bash # +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# # Cloud.com Bridge setup script. # diff --git a/awsapi-setup/setup/cloudstack-aws-api-register b/awsapi-setup/setup/cloudstack-aws-api-register index 859a57188fc..19b53fd26c5 100644 --- a/awsapi-setup/setup/cloudstack-aws-api-register +++ b/awsapi-setup/setup/cloudstack-aws-api-register @@ -1,4 +1,21 @@ #!/cygdrive/c/python26/python +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. import base64 import hmac 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..3b28c001b7d 100644 --- a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java +++ b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java @@ -1,153 +1,154 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..2f728300820 100644 --- a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationModule.java +++ b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationModule.java @@ -1,57 +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.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. +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..f7a1a7e8c6e 100644 --- a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java +++ b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.auth.s3; import java.sql.SQLException; diff --git a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java index c9a9314ba0e..b830902e044 100644 --- a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java +++ b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java @@ -1,59 +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.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. +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..2932ecd30c0 100644 --- a/awsapi/src/com/cloud/bridge/io/FileRangeDataSource.java +++ b/awsapi/src/com/cloud/bridge/io/FileRangeDataSource.java @@ -1,61 +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.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. +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..4d3c50ee9fe 100644 --- a/awsapi/src/com/cloud/bridge/io/FileRangeInputStream.java +++ b/awsapi/src/com/cloud/bridge/io/FileRangeInputStream.java @@ -1,96 +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.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. +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..03688fe3bb9 100644 --- a/awsapi/src/com/cloud/bridge/io/MultiPartDimeInputStream.java +++ b/awsapi/src/com/cloud/bridge/io/MultiPartDimeInputStream.java @@ -1,171 +1,172 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..d4856a560ce 100644 --- a/awsapi/src/com/cloud/bridge/io/S3FileSystemBucketAdapter.java +++ b/awsapi/src/com/cloud/bridge/io/S3FileSystemBucketAdapter.java @@ -1,248 +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.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. +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..22adfb8df5c 100644 --- a/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java +++ b/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java @@ -1,54 +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.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. +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..2832e1aa83a 100644 --- a/awsapi/src/com/cloud/bridge/model/MHost.java +++ b/awsapi/src/com/cloud/bridge/model/MHost.java @@ -1,113 +1,114 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..d532568087f 100644 --- a/awsapi/src/com/cloud/bridge/model/MHostMount.java +++ b/awsapi/src/com/cloud/bridge/model/MHostMount.java @@ -1,94 +1,95 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..bff7906acc5 100644 --- a/awsapi/src/com/cloud/bridge/model/SAcl.java +++ b/awsapi/src/com/cloud/bridge/model/SAcl.java @@ -1,239 +1,240 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..5f63a77fe9a 100644 --- a/awsapi/src/com/cloud/bridge/model/SBucket.java +++ b/awsapi/src/com/cloud/bridge/model/SBucket.java @@ -1,128 +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, 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. +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..874b09566d6 100644 --- a/awsapi/src/com/cloud/bridge/model/SHost.java +++ b/awsapi/src/com/cloud/bridge/model/SHost.java @@ -1,117 +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.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. +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..8962771c507 100644 --- a/awsapi/src/com/cloud/bridge/model/SMeta.java +++ b/awsapi/src/com/cloud/bridge/model/SMeta.java @@ -1,96 +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.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. +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..73a2c9a4c64 100644 --- a/awsapi/src/com/cloud/bridge/model/SObject.java +++ b/awsapi/src/com/cloud/bridge/model/SObject.java @@ -1,208 +1,209 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..14290897cba 100644 --- a/awsapi/src/com/cloud/bridge/model/SObjectItem.java +++ b/awsapi/src/com/cloud/bridge/model/SObjectItem.java @@ -1,151 +1,152 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..b674f40c191 100644 --- a/awsapi/src/com/cloud/bridge/model/UserCredentials.java +++ b/awsapi/src/com/cloud/bridge/model/UserCredentials.java @@ -1,94 +1,95 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..c7943a6c135 100644 --- a/awsapi/src/com/cloud/bridge/persist/EntityDao.java +++ b/awsapi/src/com/cloud/bridge/persist/EntityDao.java @@ -1,118 +1,119 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..b39f29821a8 100644 --- a/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java +++ b/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java @@ -1,102 +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.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. +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..8abc5dab6d1 100644 --- a/awsapi/src/com/cloud/bridge/persist/PersistContext.java +++ b/awsapi/src/com/cloud/bridge/persist/PersistContext.java @@ -1,359 +1,360 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..e2acfd2cc12 100644 --- a/awsapi/src/com/cloud/bridge/persist/PersistException.java +++ b/awsapi/src/com/cloud/bridge/persist/PersistException.java @@ -1,38 +1,39 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..83679fa002d 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/BaseDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/BaseDao.java @@ -1,75 +1,76 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..dda0e2d7128 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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; diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java index 5e804c6e9eb..31a5be873e7 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java @@ -1,34 +1,35 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..ed16974dbf1 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java @@ -1,41 +1,42 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..5013eac88d7 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java @@ -1,41 +1,42 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..1c5e81c1a31 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java @@ -1,32 +1,33 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..6753e9c95c5 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java @@ -1,32 +1,33 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..0ab83ebcf69 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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; diff --git a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java index c8433cfd376..358ce3d797f 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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; diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java index 3df0d543af4..37f18f36ade 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java @@ -1,78 +1,79 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..25845970c0f 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java @@ -1,39 +1,40 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..2641fdb3435 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java @@ -1,37 +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.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. +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..1bc7933936e 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java @@ -1,57 +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.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. +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..ac00e03b835 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java @@ -1,78 +1,79 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..62b424eb678 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java @@ -1,32 +1,33 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..4beb7a3604f 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java @@ -1,168 +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.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. +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 075a92f346b..ceaf59d4abd 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java +++ b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service; import java.io.ByteArrayInputStream; @@ -23,6 +24,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; +import java.net.URLEncoder; import java.security.KeyStore; import java.security.SignatureException; import java.security.cert.Certificate; @@ -178,7 +180,7 @@ public class EC2RestServlet extends HttpServlet { } String keystore = EC2Prop.getProperty( "keystore" ); keystorePassword = EC2Prop.getProperty( "keystorePass" ); - wsdlVersion = EC2Prop.getProperty( "WSDLVersion", "2009-11-30" ); + wsdlVersion = EC2Prop.getProperty( "WSDLVersion", "2010-11-15" ); version = EC2Prop.getProperty( "cloudbridgeVersion", "UNKNOWN VERSION" ); String installedPath = System.getenv("CATALINA_HOME"); @@ -1706,18 +1708,37 @@ public class EC2RestServlet extends HttpServlet { // [C] Verify the signature // -> getting the query-string in this way maintains its URL encoding - EC2RestAuth restAuth = new EC2RestAuth(); - restAuth.setHostHeader( request.getHeader( "Host" )); - String requestUri = request.getRequestURI(); - - //If forwarded from another basepath: - String forwardedPath = (String) request.getAttribute("javax.servlet.forward.request_uri"); - if(forwardedPath!=null){ - requestUri=forwardedPath; - } - restAuth.setHTTPRequestURI( requestUri); - restAuth.setQueryString( request.getQueryString()); - + EC2RestAuth restAuth = new EC2RestAuth(); + restAuth.setHostHeader( request.getHeader( "Host" )); + String requestUri = request.getRequestURI(); + + // If forwarded from another basepath: + String forwardedPath = (String) request.getAttribute("javax.servlet.forward.request_uri"); + if(forwardedPath!=null){ + requestUri=forwardedPath; + } + restAuth.setHTTPRequestURI( requestUri); + + String queryString = request.getQueryString(); + // getQueryString returns null (does it ever NOT return null for these), + // we need to construct queryString to avoid changing the auth code... + if (queryString == null) { + // construct our idea of a queryString with parameters! + Enumeration params = request.getParameterNames(); + if (params != null) { + while(params.hasMoreElements()) { + String paramName = (String) params.nextElement(); + // exclude the signature string obviously. ;) + if (paramName.equalsIgnoreCase("Signature")) continue; + if (queryString == null) + queryString = paramName + "=" + request.getParameter(paramName); + else + queryString = queryString + "&" + paramName + "=" + URLEncoder.encode(request.getParameter(paramName), "UTF-8"); + } + } + } + restAuth.setQueryString(queryString); + if ( restAuth.verifySignature( request.getMethod(), cloudSecretKey, signature, sigMethod )) { UserContext.current().initContext( cloudAccessKey, cloudSecretKey, cloudAccessKey, "REST request", null ); return true; @@ -1825,4 +1846,4 @@ public class EC2RestServlet extends HttpServlet { xmlWriter.close(); os.close(); } -} \ No newline at end of file +} diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java b/awsapi/src/com/cloud/bridge/service/EC2SoapService.java index 0547c90bd5a..1f7f612b4f1 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java +++ b/awsapi/src/com/cloud/bridge/service/EC2SoapService.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service; import org.apache.log4j.Logger; @@ -567,4 +568,4 @@ public class EC2SoapService implements AmazonEC2SkeletonInterface { AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class); return ec2Service.importVolume(importVolume); } -} \ No newline at end of file +} diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java index a70d930d3fc..9e10e0929a3 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java +++ b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service; import java.util.ArrayList; @@ -27,6 +28,7 @@ import com.cloud.bridge.service.core.ec2.EC2Address; import com.cloud.bridge.service.core.ec2.EC2AddressFilterSet; import com.cloud.bridge.service.core.ec2.EC2AssociateAddress; import com.cloud.bridge.service.core.ec2.EC2AuthorizeRevokeSecurityGroup; +import com.cloud.bridge.service.core.ec2.EC2AvailabilityZonesFilterSet; import com.cloud.bridge.service.core.ec2.EC2CreateImage; import com.cloud.bridge.service.core.ec2.EC2CreateImageResponse; import com.cloud.bridge.service.core.ec2.EC2CreateKeyPair; @@ -232,6 +234,12 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { if (null != items) { // -> can be empty for( int i=0; i < items.length; i++ ) request.addZone( items[i].getZoneName()); } + + FilterSetType fst = dazt.getFilterSet(); + if (fst != null) { + request.setFilterSet( toAvailabiltyZonesFilterSet(fst)); + } + return toDescribeAvailabilityZonesResponse( engine.handleRequest( request )); } @@ -1065,6 +1073,29 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { return ifs; } + + private EC2AvailabilityZonesFilterSet toAvailabiltyZonesFilterSet( FilterSetType fst ) { + EC2AvailabilityZonesFilterSet azfs = new EC2AvailabilityZonesFilterSet(); + + FilterType[] items = fst.getItem(); + if (items != null) { + for (FilterType item : items) { + EC2Filter oneFilter = new EC2Filter(); + String filterName = item.getName(); + oneFilter.setName( filterName ); + + ValueSetType vft = item.getValueSet(); + ValueType[] valueItems = vft.getItem(); + for (ValueType valueItem : valueItems) { + oneFilter.addValueEncoded( valueItem.getValue()); + } + azfs.addFilter( oneFilter ); + } + } + return azfs; + } + + // toMethods public static DescribeVolumesResponse toDescribeVolumesResponse( EC2DescribeVolumesResponse engineResponse ) { @@ -1100,7 +1131,12 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { String devicePath = engine.cloudDeviceIdToDevicePath( vol.getHypervisor(), vol.getDeviceId()); param5.setDevice( devicePath ); param5.setStatus( toVolumeAttachmentState( vol.getInstanceId(), vol.getVMState())); - param5.setAttachTime( cal ); + if (vol.getAttached() == null) { + param5.setAttachTime( cal ); + } else { + Calendar attachTime = EC2RestAuth.parseDateString(vol.getAttached()); + param5.setAttachTime( attachTime ); + } param5.setDeleteOnTermination( false ); param4.addItem( param5 ); } @@ -2248,4 +2284,4 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { public ResetSnapshotAttributeResponse resetSnapshotAttribute(ResetSnapshotAttribute resetSnapshotAttribute) { throw new EC2ServiceException(ClientError.Unsupported, "This operation is not available"); } -} \ No newline at end of file +} diff --git a/awsapi/src/com/cloud/bridge/service/S3Constants.java b/awsapi/src/com/cloud/bridge/service/S3Constants.java index ee2a1497f41..a86f3f913e1 100644 --- a/awsapi/src/com/cloud/bridge/service/S3Constants.java +++ b/awsapi/src/com/cloud/bridge/service/S3Constants.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service; + +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..282385b063e 100644 --- a/awsapi/src/com/cloud/bridge/service/S3RestServlet.java +++ b/awsapi/src/com/cloud/bridge/service/S3RestServlet.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service; import java.io.ByteArrayInputStream; @@ -66,9 +67,6 @@ import com.cloud.bridge.util.HeaderParam; import com.cloud.bridge.util.RestAuth; import com.cloud.bridge.util.S3SoapAuth; -/** - * @author Kelven Yang, Mark Joseph, John Zucker - */ public class S3RestServlet extends HttpServlet { private static final long serialVersionUID = -6168996266762804877L; public static final String ENABLE_S3_API="enable.s3.api"; @@ -870,4 +868,4 @@ private S3ObjectAction routePlainPostRequest (HttpServletRequest request) logger.info( "- End of request -" ); } } -} \ No newline at end of file +} diff --git a/awsapi/src/com/cloud/bridge/service/UserContext.java b/awsapi/src/com/cloud/bridge/service/UserContext.java index 9fdc06ca134..74e4259bfce 100644 --- a/awsapi/src/com/cloud/bridge/service/UserContext.java +++ b/awsapi/src/com/cloud/bridge/service/UserContext.java @@ -1,111 +1,109 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +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; + +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..bab10cdbd51 100644 --- a/awsapi/src/com/cloud/bridge/service/UserInfo.java +++ b/awsapi/src/com/cloud/bridge/service/UserInfo.java @@ -1,61 +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; - -/** - * @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. +package com.cloud.bridge.service; + +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..39b5cf675db 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.controller.s3; import java.io.BufferedReader; 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..0aba4ba8deb 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.controller.s3; import java.io.BufferedReader; @@ -1258,4 +1259,4 @@ public class S3ObjectAction implements ServletAction { return new OrderedPair(500, e.toString()); } } -} \ No newline at end of file +} 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..1bb5834624f 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,725 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +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..7a36a4b9bf8 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java @@ -1,20 +1,19 @@ -/** - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// 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; 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..1f73d365215 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,30 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +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..e384f1f8019 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,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.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. +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..9e2d7adddd9 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..38e5ddccf2a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Address.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Address.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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..e6000efa8be 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AddressFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AddressFilterSet.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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..3b79e9061bf 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AssociateAddress.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AssociateAddress.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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 new file mode 100644 index 00000000000..994b721203a --- /dev/null +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AvailabilityZonesFilterSet.java @@ -0,0 +1,100 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.text.ParseException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +import com.cloud.bridge.service.exception.EC2ServiceException; + + +public class EC2AvailabilityZonesFilterSet { + protected List filterSet = new ArrayList(); + + private Map filterTypes = new HashMap(); + + public EC2AvailabilityZonesFilterSet() { + // -> use these values to check that the proper filter is passed to this type of filter set + filterTypes.put( "zone-name", "String" ); + } + + public void addFilter( EC2Filter param ) { + String filterName = param.getName(); + String value = (String) filterTypes.get( filterName ); + + if (null == value) + throw new EC2ServiceException( "Unsupported filter [" + filterName + "]", 501 ); + + if (null != value && value.equalsIgnoreCase( "null" )) + throw new EC2ServiceException( "Unsupported filter [" + filterName + "]", 501 ); + + filterSet.add( param ); + } + + public EC2Filter[] getFilterSet() { + return filterSet.toArray(new EC2Filter[0]); + } + + public List evaluate( EC2DescribeAvailabilityZonesResponse availabilityZones) throws ParseException { + List resultList = new ArrayList(); + + boolean matched; + + EC2Filter[] filterSet = getFilterSet(); + for ( String availableZone : availabilityZones.getZoneSet() ) { + matched = true; + if (filterSet != null) { + for (EC2Filter filter : filterSet) { + if (!filterMatched(availableZone, filter)) { + matched = false; + break; + } + } + } + if (matched == true) + resultList.add(availableZone); + } + return resultList; + } + + private boolean filterMatched( String availableZone, EC2Filter filter ) throws ParseException { + String filterName = filter.getName(); + String[] valueSet = filter.getValueSet(); + + if ( filterName.equalsIgnoreCase("zone-name")) { + return containsString(availableZone, valueSet); + } + return false; + } + + private boolean containsString( String lookingFor, String[] set ){ + if (lookingFor == null) + return false; + + for (String filter: set) { + if (lookingFor.matches( filter )) return true; + } + return false; + } + +} 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..b68928d0d0f 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,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; - -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. +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..355312d2d14 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,34 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..e21941f8dec 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateKeyPair.java @@ -1,25 +1,22 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; -/** - * @author slriv - * - */ public class EC2CreateKeyPair { private String keyName; 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..db9d956e7b4 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,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.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. +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..35eed1e51e9 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DeleteKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DeleteKeyPair.java @@ -1,25 +1,22 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; -/** - * @author slriv - * - */ public class EC2DeleteKeyPair { private String keyName; 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..f97ea2aa4c7 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddresses.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddresses.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; import java.util.HashSet; 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..60263822c89 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddressesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddressesResponse.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; import java.util.ArrayList; 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 ba445677d2a..d447518c7e3 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZones.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZones.java @@ -1,35 +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.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 - - public EC2DescribeAvailabilityZones() { - } - - public void addZone( String param ) { - zoneSet.add( param ); - } - - public String[] getZoneSet() { - return zoneSet.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. +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 EC2AvailabilityZonesFilterSet getFilterSet() { + return azfs; + } + + public void setFilterSet( EC2AvailabilityZonesFilterSet param ) { + 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..ae0c233f83f 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,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; - -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. +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..1158b7aa359 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,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.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. +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..9c51b68df7f 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,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 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. +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..25e4ad0deed 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..e79cd9da870 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,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.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. +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..c7533bfb7d1 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..d75d38e5f11 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairs.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairs.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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..cfa0262b41f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairsResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairsResponse.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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..1bf6e3783e1 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,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.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. +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..beb213fe2f3 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..04145fa36c7 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,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.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. +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..28d8f93f7fc 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,40 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..09048735d79 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DisassociateAddress.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DisassociateAddress.java @@ -1,24 +1,21 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; -/** - * @author slriv - * - */ public class EC2DisassociateAddress { private String publicIp; 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 b21940d23ee..0d2e713d83f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; import java.io.File; @@ -1120,10 +1121,16 @@ public class EC2Engine { */ public EC2DescribeAvailabilityZonesResponse handleRequest(EC2DescribeAvailabilityZones request) { try { - CloudStackAccount caller = getCurrentAccount(); - - return listZones(request.getZoneSet(), null); - + EC2DescribeAvailabilityZonesResponse availableZones = listZones(request.getZoneSet(), null); + EC2AvailabilityZonesFilterSet azfs = request.getFilterSet(); + if ( null == azfs ) + return availableZones; + else { + List matchedAvailableZones = azfs.evaluate(availableZones); + if (matchedAvailableZones.isEmpty()) + return new EC2DescribeAvailabilityZonesResponse(); + return listZones(matchedAvailableZones.toArray(new String[0]), null); + } } catch( EC2ServiceException error ) { logger.error( "EC2 DescribeAvailabilityZones - ", error); throw error; 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..bdd814e0773 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Filter.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Filter.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; import java.util.ArrayList; 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..149d25f6151 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2GroupFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2GroupFilterSet.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.text.ParseException; 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..75e792b1a1b 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,108 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..d8b2f45038f 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,87 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..376a63ee59e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImportKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImportKeyPair.java @@ -1,25 +1,22 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; -/** - * @author slriv - * - */ public class EC2ImportKeyPair { private String keyName; 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..064d7e077a6 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,201 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..6d5255ab2d8 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; import java.text.ParseException; 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..4149e1714ec 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,121 @@ -/* - * 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. +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..16237038bda 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2KeyPairFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2KeyPairFilterSet.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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..16f5ef750c7 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,95 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..a331bfa4dd2 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..3fd36ba358b 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,95 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..61826347f0b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ReleaseAddress.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ReleaseAddress.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; 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..e3735b5a12e 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,126 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..f6873169e44 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,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.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. +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..339506deda0 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,119 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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 c69191cba94..1c428f029cc 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SnapshotFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SnapshotFilterSet.java @@ -1,30 +1,34 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.text.ParseException; import java.util.ArrayList; import java.util.Calendar; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TimeZone; import com.cloud.bridge.service.UserContext; import com.cloud.bridge.service.exception.EC2ServiceException; import com.cloud.bridge.util.DateHelper; +import com.cloud.bridge.util.EC2RestAuth; public class EC2SnapshotFilterSet { @@ -121,7 +125,12 @@ public class EC2SnapshotFilterSet { } else if (filterName.equalsIgnoreCase( "status" )) { - return containsString( "completed", valueSet ); + if ( snap.getState().equalsIgnoreCase("backedup")) + return containsString( "completed", valueSet ); + else if (snap.getState().equalsIgnoreCase("creating") || snap.getState().equalsIgnoreCase("backingup")) + return containsString( "pending", valueSet ); + else + return containsString( "error", valueSet ); } else if (filterName.equalsIgnoreCase( "volume-id" )) { @@ -160,11 +169,14 @@ public class EC2SnapshotFilterSet { private boolean containsTime( Calendar lookingFor, String[] set ) throws ParseException { + lookingFor.setTimeZone(TimeZone.getTimeZone("GMT")); + Date lookingForDate = lookingFor.getTime(); for (String s : set) { //System.out.println( "contsinsCalendar: " + lookingFor + " " + set[i] ); - Calendar toMatch = Calendar.getInstance(); - toMatch.setTime( DateHelper.parseISO8601DateString( s )); - if (0 == lookingFor.compareTo( toMatch )) return true; + Calendar toMatch = EC2RestAuth.parseDateString(s); + toMatch.setTimeZone(TimeZone.getTimeZone("GMT")); + Date toMatchDate = toMatch.getTime(); + if ( 0 == lookingForDate.compareTo(toMatchDate)) return true; } return false; } 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..3e4a5a85c5c 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..e424027f6f7 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,37 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..13e23d1a51f 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,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.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. +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..cf3ad518ebc 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,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..009c17aa687 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,234 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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 663544e0608..95d306f7c00 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2VolumeFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2VolumeFilterSet.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.text.ParseException; @@ -21,9 +22,10 @@ import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TimeZone; +import java.util.Date; import com.cloud.bridge.service.exception.EC2ServiceException; -import com.cloud.bridge.util.DateHelper; import com.cloud.bridge.util.EC2RestAuth; @@ -123,8 +125,14 @@ public class EC2VolumeFilterSet { return containsString(vol.getState(), valueSet ); else if (filterName.equalsIgnoreCase( "volume-id" )) return containsString(vol.getId().toString(), valueSet ); - else if (filterName.equalsIgnoreCase( "attachment.attach-time" )) - return containsTime(vol.getAttached(), valueSet ); + else if (filterName.equalsIgnoreCase( "attachment.attach-time" )) { + if (vol.getAttached() != null) + return containsTime(vol.getAttached(), valueSet ); + else if (vol.getInstanceId() != null) + return containsTime(vol.getCreated(), valueSet); + else + return false; + } else if (filterName.equalsIgnoreCase( "attachment.device" )) return containsDevice(vol.getDeviceId(), valueSet ); else if (filterName.equalsIgnoreCase( "attachment.instance-id" )) @@ -155,14 +163,17 @@ public class EC2VolumeFilterSet { private boolean containsTime(String lookingForDate, String[] set ) throws ParseException { - Calendar lookingFor = EC2RestAuth.parseDateString(lookingForDate); - for (String s : set) { - Calendar toMatch = Calendar.getInstance(); - toMatch.setTime( DateHelper.parseISO8601DateString( s )); - if (0 == lookingFor.compareTo( toMatch )) return true; - } - return false; - } + Calendar lookingFor = EC2RestAuth.parseDateString(lookingForDate); + lookingFor.setTimeZone(TimeZone.getTimeZone("GMT")); + Date lookForDate = lookingFor.getTime(); + for (String s : set) { + Calendar toMatch = EC2RestAuth.parseDateString(s); + toMatch.setTimeZone(TimeZone.getTimeZone("GMT")); + Date toMatchDate = toMatch.getTime(); + if ( 0 == lookForDate.compareTo(toMatchDate)) return true; + } + return false; + } private boolean containsDevice(String deviceId, String[] set ) 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..d04c3492e72 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/IpForwardingRuleResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/IpForwardingRuleResponse.java @@ -1,20 +1,19 @@ -/** - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved - * - * This software is licensed under the GNU General Public License v3 or later. - * - * It is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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; 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..05b2c03c24b 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,35 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..c7027f4a2ee 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,88 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..a5bb0fc2e33 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,37 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..a66d6a4895d 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,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.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. +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..8dcb3116cc8 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,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.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. +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..f4bd06e96a7 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,35 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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; + +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..e0b51666ce0 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketPolicy.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketPolicy.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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; 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..f2b502a8783 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,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.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. +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..1bbba5c249a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionFactory.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionFactory.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.HashMap; 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..00f947f45a4 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectRequest.java @@ -1,12 +1,20 @@ -/** - * - */ -package com.cloud.bridge.service.core.s3; +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. -/** - * @author Mark - * - */ public class S3CopyObjectRequest extends S3Request { public enum MetadataDirective { COPY, REPLACE }; 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..7b48f8ae4e0 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,40 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; +import com.cloud.bridge.util.XSerializer; + +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..01ee973c4be 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,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 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. +package com.cloud.bridge.service.core.s3; + +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..4003709e8cf 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,33 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +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..a5ae0a26400 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,33 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +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..e4aaf586062 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,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.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. +package com.cloud.bridge.service.core.s3; + +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..e8b73a42439 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,1879 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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; + +/** + * 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..cca25c2d7a3 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,33 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +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..6ecd8193054 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,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 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. +package com.cloud.bridge.service.core.s3; + +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..b6c0c6dd349 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,116 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +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..2f1911553bd 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,93 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +import javax.activation.DataHandler; + +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..b3c07beb16a 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,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.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. +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; + +/** + * 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..03c07a11559 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; @@ -5,7 +21,7 @@ import java.net.URL; import java.util.Iterator; import java.util.Map; -/* @auth John Zucker +/* * Provide a suitable subclass of format class to reflect the choice of bucket referencing format supported by * AWS S3 in constructing the URL for requesting RESTful services. The three possibilities are * (*) hostname followed by bucket as path information (sometimes termed the path style) @@ -138,4 +154,4 @@ public abstract class S3HostCallingFormat return bucket.length() != 0; } } -} \ No newline at end of file +} 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..d561fb0f939 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,56 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; +import java.util.TimeZone; + +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..9eac964eab7 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,23 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +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..35d81e0d558 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,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.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. +package com.cloud.bridge.service.core.s3; + +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..3486965a21b 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,139 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +import com.cloud.bridge.util.XElement; + +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..f08e2c18bc5 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,37 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; + +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..d395f919a0b 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,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 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. +package com.cloud.bridge.service.core.s3; + +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..bfae0a50dfd 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,122 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; + +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..c4505f62228 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,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 - */ -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. +package com.cloud.bridge.service.core.s3; + +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..a4350622d3e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartPart.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartPart.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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/S3MultipartUpload.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java index 355f9ed07a1..ea47ce58929 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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/S3PolicyAction.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java index 33daadeb017..cc3283ffbcb 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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; 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..50634374387 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyArnCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyArnCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.ParseException; 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..9a957884e87 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyBoolCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyBoolCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.ParseException; 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..6ab5dec0945 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.Set; 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..a884ea6d6e6 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyConditionBlock.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyConditionBlock.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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; 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..b83c7f4d53a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyContext.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyContext.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.HashMap; 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..56a7d7bfe6a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyDateCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyDateCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.ParseException; 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..01705324377 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyIPAddressCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyIPAddressCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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; 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..a2089241b05 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyNumericCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyNumericCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.ParseException; 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..e277847af31 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyPrincipal.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyPrincipal.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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; 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..12ff0ff5673 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStatement.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStatement.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.service.core.s3.S3BucketPolicy.PolicyAccess; 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..d046db9e3b3 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStringCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStringCondition.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, 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.ParseException; 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..c3a0debca50 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,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.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. +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..b75ee05c781 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,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.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. +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..076e61a6830 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,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.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. +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..28385e396f2 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,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.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. +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..439b98d3ac9 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,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 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. +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..c014c067ae9 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,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; - -/** - * @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. +package com.cloud.bridge.service.core.s3; + +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..b2091c4f1a3 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,42 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +package com.cloud.bridge.service.core.s3; + +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..2683eb7b242 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,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 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. +package com.cloud.bridge.service.core.s3; + +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..982e1cd13fc 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/ConfigurationException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/ConfigurationException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..f40278d25e2 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java @@ -1,151 +1,152 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +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..c35412f30a3 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/FileNotExistException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/FileNotExistException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..71667be8948 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/HostNotMountedException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/HostNotMountedException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..88916c5cdc8 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/InternalErrorException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/InternalErrorException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..841f19e38da 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/InvalidRequestContentException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/InvalidRequestContentException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..6d0c9260fd5 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/NetworkIOException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/NetworkIOException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..be9b58d4e97 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/NoSuchObjectException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/NoSuchObjectException.java @@ -1,39 +1,37 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..6358cba0f8e 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/ObjectAlreadyExistsException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/ObjectAlreadyExistsException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..c680bb94da7 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/OutOfServiceException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/OutOfServiceException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..2d2f46217e6 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/OutOfStorageException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/OutOfStorageException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..95d20e9bdfb 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/PermissionDeniedException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/PermissionDeniedException.java @@ -1,38 +1,36 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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. +package com.cloud.bridge.service.exception; + +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..ab27c1d3f33 100644 --- a/awsapi/src/com/cloud/bridge/tool/CloudS3CmdTool.java +++ b/awsapi/src/com/cloud/bridge/tool/CloudS3CmdTool.java @@ -1,325 +1,323 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..fb2fc393691 100644 --- a/awsapi/src/com/cloud/bridge/util/AuthenticationUtils.java +++ b/awsapi/src/com/cloud/bridge/util/AuthenticationUtils.java @@ -1,46 +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; - -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. +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..a5d92b748f5 100644 --- a/awsapi/src/com/cloud/bridge/util/CalendarDateParam.java +++ b/awsapi/src/com/cloud/bridge/util/CalendarDateParam.java @@ -1,34 +1,32 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +import java.util.Calendar; + +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..404f4636a8b 100644 --- a/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java +++ b/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java @@ -1,108 +1,106 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..a5e97b81fd6 100644 --- a/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java +++ b/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java @@ -1,109 +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.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. +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..0d96c30c449 100644 --- a/awsapi/src/com/cloud/bridge/util/ConfigurationHelper.java +++ b/awsapi/src/com/cloud/bridge/util/ConfigurationHelper.java @@ -1,104 +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.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. +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; + + +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..2640c5f3480 100644 --- a/awsapi/src/com/cloud/bridge/util/Converter.java +++ b/awsapi/src/com/cloud/bridge/util/Converter.java @@ -1,68 +1,66 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +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..f759a06cc01 100644 --- a/awsapi/src/com/cloud/bridge/util/CryptoHelper.java +++ b/awsapi/src/com/cloud/bridge/util/CryptoHelper.java @@ -1,22 +1,20 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +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..1d990965dd3 100644 --- a/awsapi/src/com/cloud/bridge/util/DatabindingConverterUtil.java +++ b/awsapi/src/com/cloud/bridge/util/DatabindingConverterUtil.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.util; @@ -23,7 +24,6 @@ import java.util.Date; import org.apache.axis2.databinding.utils.ConverterUtil; /** - * @author John Zucker * Custom subclass of org.apache.axis2.databinding.utils.ConverterUtil, i.e. the data conversion utility for * databindings in the ADB framework of Axis2. The purpose of a custom class is to provide specific value * format conversions for certain datatypes, especially dates, timestamps and calendars for which the default diff --git a/awsapi/src/com/cloud/bridge/util/DateHelper.java b/awsapi/src/com/cloud/bridge/util/DateHelper.java index b86181540b3..2f16ef8159c 100644 --- a/awsapi/src/com/cloud/bridge/util/DateHelper.java +++ b/awsapi/src/com/cloud/bridge/util/DateHelper.java @@ -1,96 +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.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. +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; + +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..67b60765a26 100644 --- a/awsapi/src/com/cloud/bridge/util/EC2RestAuth.java +++ b/awsapi/src/com/cloud/bridge/util/EC2RestAuth.java @@ -1,273 +1,274 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..8a4274daee2 100644 --- a/awsapi/src/com/cloud/bridge/util/EntityParam.java +++ b/awsapi/src/com/cloud/bridge/util/EntityParam.java @@ -1,31 +1,29 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +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..18764198f61 100644 --- a/awsapi/src/com/cloud/bridge/util/ISO8601SimpleDateTimeFormat.java +++ b/awsapi/src/com/cloud/bridge/util/ISO8601SimpleDateTimeFormat.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.util; diff --git a/awsapi/src/com/cloud/bridge/util/IpAddressRange.java b/awsapi/src/com/cloud/bridge/util/IpAddressRange.java index 365d48802ed..e8a6d82a33d 100644 --- a/awsapi/src/com/cloud/bridge/util/IpAddressRange.java +++ b/awsapi/src/com/cloud/bridge/util/IpAddressRange.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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; diff --git a/awsapi/src/com/cloud/bridge/util/IteratorHelper.java b/awsapi/src/com/cloud/bridge/util/IteratorHelper.java index f2573b7112c..42befd37de4 100644 --- a/awsapi/src/com/cloud/bridge/util/IteratorHelper.java +++ b/awsapi/src/com/cloud/bridge/util/IteratorHelper.java @@ -1,56 +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.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. +package com.cloud.bridge.util; + +import java.util.Enumeration; +import java.util.Iterator; + +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..c7720f659fa 100644 --- a/awsapi/src/com/cloud/bridge/util/JsonAccessor.java +++ b/awsapi/src/com/cloud/bridge/util/JsonAccessor.java @@ -1,251 +1,251 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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 + * + */ +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..caddec2f25d 100644 --- a/awsapi/src/com/cloud/bridge/util/NetHelper.java +++ b/awsapi/src/com/cloud/bridge/util/NetHelper.java @@ -1,97 +1,95 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..3c8d0d55903 100644 --- a/awsapi/src/com/cloud/bridge/util/OrderedPair.java +++ b/awsapi/src/com/cloud/bridge/util/OrderedPair.java @@ -1,52 +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.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. +package com.cloud.bridge.util; + +/** + * 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..4d9a507190a 100644 --- a/awsapi/src/com/cloud/bridge/util/PolicyParser.java +++ b/awsapi/src/com/cloud/bridge/util/PolicyParser.java @@ -1,18 +1,19 @@ -/* - * 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. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.ArrayList; diff --git a/awsapi/src/com/cloud/bridge/util/QueryHelper.java b/awsapi/src/com/cloud/bridge/util/QueryHelper.java index 279c4d6995b..1a1b58290e1 100644 --- a/awsapi/src/com/cloud/bridge/util/QueryHelper.java +++ b/awsapi/src/com/cloud/bridge/util/QueryHelper.java @@ -1,87 +1,85 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..33d2d479a67 100644 --- a/awsapi/src/com/cloud/bridge/util/RestAuth.java +++ b/awsapi/src/com/cloud/bridge/util/RestAuth.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.util; import java.security.InvalidKeyException; @@ -37,7 +38,6 @@ import org.apache.log4j.Logger; * This class is used for the Authentication check for REST requests and Query String * Authentication requests. * - * @author Kelven Yang, John Zucker, Salvatore Orlando */ public class RestAuth { diff --git a/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java b/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java index 99c4e64a267..69549d0eb14 100644 --- a/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java +++ b/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java @@ -1,73 +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.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. +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..209feb3b8e7 100644 --- a/awsapi/src/com/cloud/bridge/util/ServletRequestDataSource.java +++ b/awsapi/src/com/cloud/bridge/util/ServletRequestDataSource.java @@ -1,61 +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.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. +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; + +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..30317197744 100644 --- a/awsapi/src/com/cloud/bridge/util/StringHelper.java +++ b/awsapi/src/com/cloud/bridge/util/StringHelper.java @@ -1,111 +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.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. +package com.cloud.bridge.util; + +import java.io.IOException; +import java.io.InputStream; + +/** + * 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..0ac631115ec 100644 --- a/awsapi/src/com/cloud/bridge/util/TextParam.java +++ b/awsapi/src/com/cloud/bridge/util/TextParam.java @@ -1,31 +1,29 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +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..fb01612bd69 100644 --- a/awsapi/src/com/cloud/bridge/util/TimeParam.java +++ b/awsapi/src/com/cloud/bridge/util/TimeParam.java @@ -1,33 +1,31 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +import java.util.Date; + +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..e1b2d315589 100644 --- a/awsapi/src/com/cloud/bridge/util/TimestampParam.java +++ b/awsapi/src/com/cloud/bridge/util/TimestampParam.java @@ -1,33 +1,31 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +import java.util.Date; + +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..dd5aae7f41d 100644 --- a/awsapi/src/com/cloud/bridge/util/Triple.java +++ b/awsapi/src/com/cloud/bridge/util/Triple.java @@ -1,22 +1,22 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.util; /** - * @author Kelven Yang, John Zucker * Reusable class whose instances encode any triple (or 3-tuple) of values of types T1, T2 and T3 * Provide getters: getFirst(), getSecond(), getThird() * Provide setters: setFirst(val), setSecond(val), setThird(val) @@ -61,4 +61,4 @@ public class Triple { third = t3; return this; } -} \ No newline at end of file +} diff --git a/awsapi/src/com/cloud/bridge/util/XElement.java b/awsapi/src/com/cloud/bridge/util/XElement.java index d330ddf3b23..7fc70a39e1f 100644 --- a/awsapi/src/com/cloud/bridge/util/XElement.java +++ b/awsapi/src/com/cloud/bridge/util/XElement.java @@ -1,33 +1,31 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +@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..d9c894554d0 100644 --- a/awsapi/src/com/cloud/bridge/util/XFlatten.java +++ b/awsapi/src/com/cloud/bridge/util/XFlatten.java @@ -1,30 +1,31 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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..60b879c99e2 100644 --- a/awsapi/src/com/cloud/bridge/util/XOmitNull.java +++ b/awsapi/src/com/cloud/bridge/util/XOmitNull.java @@ -1,30 +1,28 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +@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..2451e9c8fbf 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializable.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializable.java @@ -1,28 +1,26 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +import java.io.PrintWriter; + +import org.w3c.dom.Node; + +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..12c74013964 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializer.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializer.java @@ -1,498 +1,496 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..a695412a01e 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializerAdapter.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializerAdapter.java @@ -1,32 +1,30 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +package com.cloud.bridge.util; + +import java.io.PrintWriter; +import java.lang.reflect.Field; + +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..9662f507142 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializerJsonAdapter.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializerJsonAdapter.java @@ -1,165 +1,163 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..212b70e0422 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializerXmlAdapter.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializerXmlAdapter.java @@ -1,173 +1,171 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..d8f6b94d9ce 100644 --- a/awsapi/src/com/cloud/bridge/util/XmlHelper.java +++ b/awsapi/src/com/cloud/bridge/util/XmlHelper.java @@ -1,175 +1,173 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF 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. +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; + +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..65db1397973 100644 --- a/awsapi/src/com/cloud/stack/CloudStackApi.java +++ b/awsapi/src/com/cloud/stack/CloudStackApi.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack; @@ -56,7 +57,6 @@ import com.google.gson.reflect.TypeToken; /** * The goal here is to wrap the actual CloudStack API calls... * - * @author slriv * */ public class CloudStackApi { diff --git a/awsapi/src/com/cloud/stack/CloudStackClient.java b/awsapi/src/com/cloud/stack/CloudStackClient.java index ed04737a2ad..5002aa593e7 100644 --- a/awsapi/src/com/cloud/stack/CloudStackClient.java +++ b/awsapi/src/com/cloud/stack/CloudStackClient.java @@ -1,197 +1,197 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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 + * + */ +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..ea73df47fd2 100644 --- a/awsapi/src/com/cloud/stack/CloudStackCommand.java +++ b/awsapi/src/com/cloud/stack/CloudStackCommand.java @@ -1,149 +1,149 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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 + * + */ +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..3305843f3e1 100644 --- a/awsapi/src/com/cloud/stack/models/ApiConstants.java +++ b/awsapi/src/com/cloud/stack/models/ApiConstants.java @@ -1,506 +1,507 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..0da846ccaf4 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackAccount.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackAccount.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackAccount { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java b/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java index dd75f43d192..629fa95900b 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackCapabilities { @SerializedName(ApiConstants.CLOUD_STACK_VERSION) private String cloudStackVersion; 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..308941c7ef6 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackDiskOffering.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackDiskOffering.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackDiskOffering { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackEvent.java b/awsapi/src/com/cloud/stack/models/CloudStackEvent.java index 6897c5d43bd..6b986760e57 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackEvent.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackEvent.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackEvent { @SerializedName(ApiConstants.ID) private Long id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackEventType.java b/awsapi/src/com/cloud/stack/models/CloudStackEventType.java index aa076b1a74d..81202e233ee 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackEventType.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackEventType.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackEventType { @SerializedName(ApiConstants.NAME) private String name; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java b/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java index f0ce590bb2d..c0974c036ad 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackExtractTemplate { @SerializedName(ApiConstants.ID) Long id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java b/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java index 2370ce6edc6..5fa450ee9e0 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackIdentifier { @SerializedName(ApiConstants.CLOUD_IDENTIFIER) private String cloudIdentifier; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java b/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java index 580f75c63e1..f78482a77fe 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java @@ -1,58 +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.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. +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..68d54620147 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackIngressRule.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackIngressRule.java @@ -1,87 +1,88 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..cf012e51d2d 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackInstanceGroup.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackInstanceGroup.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackInstanceGroup { @SerializedName(ApiConstants.ID) private Long id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java b/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java index d89e2a62fbf..72a3d515189 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java @@ -1,151 +1,152 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..221f0ddfa2b 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackKeyPair.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackKeyPair.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java b/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java index 98d422caf3d..9ce2d884554 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java @@ -1,25 +1,22 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; -/** - * @author slriv - * - */ public class CloudStackKeyValue { private String key; private String value; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java b/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java index 1a95e060078..9e4451e0994 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackLoadBalancerRule { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java b/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java index 978d77e3c42..bbc0cefac7d 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; @@ -20,10 +21,6 @@ import java.util.List; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackNetwork { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java b/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java index d1c6f961513..576b426cb96 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackNetworkOffering { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java b/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java index b2e21f2abec..81f6a090ce7 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; @@ -20,10 +21,6 @@ import java.util.List; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackNetworkService { @SerializedName(ApiConstants.NAME) diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java b/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java index 573e91512ec..e59898c3bf0 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackNetworkServiceCapability { @SerializedName(ApiConstants.NAME) private String name; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNic.java b/awsapi/src/com/cloud/stack/models/CloudStackNic.java index f6156eec2d9..a3fde39f7fb 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNic.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNic.java @@ -1,104 +1,105 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..715c34e3e1f 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackOsCategory.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackOsCategory.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackOsCategory { @SerializedName(ApiConstants.ID) private Long id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackOsType.java b/awsapi/src/com/cloud/stack/models/CloudStackOsType.java index 29ca6d0db7a..65ad90e5f55 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackOsType.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackOsType.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackOsType { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java b/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java index 434d70bd6b3..115125c5072 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackPasswordData { @SerializedName(ApiConstants.ENCRYPTED_PASSWORD) diff --git a/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java b/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java index 208f32dae07..19aedfac9e0 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackPortForwardingRule { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java b/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java index 1f9bd677d6c..9ca45ae7a17 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java @@ -1,55 +1,56 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..72ba5529670 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroup.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroup.java @@ -1,81 +1,82 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..a8690ee68c5 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroupIngress.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroupIngress.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackSecurityGroupIngress { @SerializedName(ApiConstants.ACCOUNT) private String account; 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..3dcf011ef5b 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackServiceOffering { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java b/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java index a43ff55409a..73dc4cd13ae 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java @@ -1,108 +1,109 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..b494d742bd6 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSnapshotPolicy.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSnapshotPolicy.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackSnapshotPolicy { @SerializedName(ApiConstants.ID) diff --git a/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java b/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java index 9cd8e84e753..14d6e823cd4 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java @@ -1,27 +1,24 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackTemplate { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java b/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java index d627dadfaed..5d7652d1d75 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java @@ -1,18 +1,19 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; @@ -20,10 +21,6 @@ import java.util.List; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackTemplatePermission { @SerializedName(ApiConstants.ID) private String id; diff --git a/awsapi/src/com/cloud/stack/models/CloudStackUser.java b/awsapi/src/com/cloud/stack/models/CloudStackUser.java index d93cb2b10be..cdcfdae2850 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackUser.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackUser.java @@ -1,26 +1,23 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.stack.models; import com.google.gson.annotations.SerializedName; -/** - * @author slriv - * - */ public class CloudStackUser { @SerializedName(ApiConstants.ID) diff --git a/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java b/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java index bc27e49ff7b..f72e1b62b22 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java @@ -1,397 +1,398 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..13d87f4bec8 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackVolume.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackVolume.java @@ -1,336 +1,337 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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..a369840f986 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackZone.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackZone.java @@ -1,177 +1,178 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS 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. +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 + + diff --git a/build.xml b/build.xml index e9e4bef6145..4b103b2e0a7 100755 --- a/build.xml +++ b/build.xml @@ -21,11 +21,13 @@ + + diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml new file mode 100755 index 00000000000..61b0e624901 --- /dev/null +++ b/build/build-cloud-plugins.xml @@ -0,0 +1,322 @@ + + + + + + + + + + + + + Cloud Stack ant build file for building all the plugins + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build-cloud.xml b/build/build-cloud.xml index 76d2bc85e29..b8ad09edc30 100755 --- a/build/build-cloud.xml +++ b/build/build-cloud.xml @@ -285,7 +285,6 @@ - @@ -480,7 +479,7 @@ - + @@ -586,24 +585,11 @@ - - - - - - - - - - - - - + - + + - - diff --git a/build/build-common.xml b/build/build-common.xml index 1d1aa87361d..7240f5323c3 100755 --- a/build/build-common.xml +++ b/build/build-common.xml @@ -73,7 +73,7 @@ - + diff --git a/build/build-devcloud.xml b/build/build-devcloud.xml new file mode 100644 index 00000000000..5b7bcdb7eee --- /dev/null +++ b/build/build-devcloud.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/developer.xml b/build/developer.xml index 127581e2d4e..4d466b76478 100755 --- a/build/developer.xml +++ b/build/developer.xml @@ -36,8 +36,6 @@ - - @@ -163,11 +161,7 @@ - - - - - + diff --git a/build/package.xml b/build/package.xml index 7fd7a5d1a5d..2b5a74b123a 100755 --- a/build/package.xml +++ b/build/package.xml @@ -156,7 +156,7 @@ - + @@ -226,6 +226,7 @@ + diff --git a/build/replace.properties b/build/replace.properties deleted file mode 100644 index 7c5fd3de052..00000000000 --- a/build/replace.properties +++ /dev/null @@ -1,10 +0,0 @@ -DBUSER=cloud -DBPW=cloud -MSLOG=vmops.log -APISERVERLOG=api.log -DBHOST=localhost -AGENTLOGDIR=logs -AGENTLOG=logs/agent.log -MSMNTDIR=/mnt -COMPONENTS-SPEC=components-premium.xml -AWSAPILOG=awsapi.log diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 7b0f264f46b..52e6900d963 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -18,14 +18,14 @@ label.vcipaddress=vCenter IP Address label.vsmctrlvlanid=Control VLAN ID label.vsmpktvlanid=Packet VLAN ID label.vsmstoragevlanid=Storage VLAN ID -label.nexusVswitch=Nexus Vswitch -label.action.delete.nexusVswitch=Delete NexusVswitch -label.action.enable.nexusVswitch=Enable NexusVswitch -label.action.disable.nexusVswitch=Disable NexusVswitch -label.action.list.nexusVswitch=List NexusVswitch -message.action.delete.nexusVswitch=Please confirm that you want to delete this nexusVswitch. -message.action.enable.nexusVswitch=Please confirm that you want to enable this nexusVswitch. -message.action.disable.nexusVswitch=Please confirm that you want to disable this nexusVswitch. +label.nexusVswitch=Nexus 1000v +label.action.delete.nexusVswitch=Delete Nexus 1000v +label.action.enable.nexusVswitch=Enable Nexus 1000v +label.action.disable.nexusVswitch=Disable Nexus 1000v +label.action.list.nexusVswitch=List Nexus 1000v +message.action.delete.nexusVswitch=Please confirm that you want to delete this nexus 1000v +message.action.enable.nexusVswitch=Please confirm that you want to enable this nexus 1000v +message.action.disable.nexusVswitch=Please confirm that you want to disable this nexus 1000v message.specify.url=Please specify URL label.select.instance.to.attach.volume.to=Select instance to attach volume to label.upload=Upload diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 6ef0961d5c3..cb96b1e713d 100755 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -337,4 +337,9 @@ deleteNetworkDevice=com.cloud.api.commands.DeleteNetworkDeviceCmd;1 addRegion=com.cloud.api.commands.AddRegionCmd;1 updateRegion=com.cloud.api.commands.UpdateRegionCmd;1 removeRegion=com.cloud.api.commands.RemoveRegionCmd;1 -listRegions=com.cloud.api.commands.ListRegionsCmd;7 \ No newline at end of file +listRegions=com.cloud.api.commands.ListRegionsCmd;7 + +#### Tags commands +createTags=com.cloud.api.commands.CreateTagsCmd;15 +deleteTags=com.cloud.api.commands.DeleteTagsCmd;15 +listTags=com.cloud.api.commands.ListTagsCmd;15 diff --git a/client/tomcatconf/components.xml.in b/client/tomcatconf/components.xml.in index 48869b5daee..f36355d4ff3 100755 --- a/client/tomcatconf/components.xml.in +++ b/client/tomcatconf/components.xml.in @@ -133,9 +133,9 @@ - - - + + + @@ -157,7 +157,23 @@ + + + + + + + + + + + + + + + + diff --git a/cloud.spec b/cloud.spec index 83af1e6576d..f4ca068e644 100644 --- a/cloud.spec +++ b/cloud.spec @@ -414,6 +414,19 @@ fi %{_javadir}/%{name}-server.jar %{_javadir}/%{name}-vmware-base.jar %{_javadir}/%{name}-ovm.jar +%{_javadir}/%{name}-dp-user-concentrated-pod.jar +%{_javadir}/%{name}-dp-user-dispersing.jar +%{_javadir}/%{name}-host-allocator-random.jar +%{_javadir}/%{name}-plugin-f5.jar +%{_javadir}/%{name}-plugin-netscaler.jar +%{_javadir}/%{name}-plugin-ovs.jar +%{_javadir}/%{name}-plugin-srx.jar +%{_javadir}/%{name}-storage-allocator-random.jar +%{_javadir}/%{name}-user-authenticator-ldap.jar +%{_javadir}/%{name}-user-authenticator-md5.jar +%{_javadir}/%{name}-user-authenticator-plaintext.jar +%{_javadir}/%{name}-vmware.jar +%{_javadir}/%{name}-xen.jar %config(noreplace) %{_sysconfdir}/%{name}/server/* %files agent-scripts diff --git a/console-proxy/conf/log4j-cloud.xml b/console-proxy/conf/log4j-cloud.xml index 9112df7fb5a..7e455c12966 100644 --- a/console-proxy/conf/log4j-cloud.xml +++ b/console-proxy/conf/log4j-cloud.xml @@ -9,7 +9,7 @@ - + diff --git a/console-proxy/scripts/_run.sh b/console-proxy/scripts/_run.sh index ebe5c5411bf..e408378afbc 100755 --- a/console-proxy/scripts/_run.sh +++ b/console-proxy/scripts/_run.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/scripts/config_auth.sh b/console-proxy/scripts/config_auth.sh index 3db5fb6360f..4b74f8eb995 100755 --- a/console-proxy/scripts/config_auth.sh +++ b/console-proxy/scripts/config_auth.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/scripts/config_ssl.sh b/console-proxy/scripts/config_ssl.sh index b583426dfff..8d80c4731ad 100755 --- a/console-proxy/scripts/config_ssl.sh +++ b/console-proxy/scripts/config_ssl.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/scripts/ipfirewall.sh b/console-proxy/scripts/ipfirewall.sh index a6fe39a5156..4711b8ac6db 100755 --- a/console-proxy/scripts/ipfirewall.sh +++ b/console-proxy/scripts/ipfirewall.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/scripts/run-proxy.sh b/console-proxy/scripts/run-proxy.sh index 83f6117ef55..d6ccf7c0091 100644 --- a/console-proxy/scripts/run-proxy.sh +++ b/console-proxy/scripts/run-proxy.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/scripts/run.sh b/console-proxy/scripts/run.sh index 755ccdd9671..146d96f0287 100755 --- a/console-proxy/scripts/run.sh +++ b/console-proxy/scripts/run.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/scripts/ssvm-check.sh b/console-proxy/scripts/ssvm-check.sh index b19961b8f50..a4011647f07 100644 --- a/console-proxy/scripts/ssvm-check.sh +++ b/console-proxy/scripts/ssvm-check.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyVncClient.java b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyVncClient.java index b23b6c30db1..77a9977c90b 100644 --- a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyVncClient.java +++ b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyVncClient.java @@ -189,24 +189,25 @@ public class ConsoleProxyVncClient extends ConsoleProxyClientBase { updateFrontEndActivityTime(); - int pointerMask = 0; - int mask = 1; - if(code == 2) - mask = 4; - - if(event == InputEventType.MOUSE_DOWN) { - pointerMask = mask; - lastPointerMask = pointerMask; - } else if(event == InputEventType.MOUSE_UP) { - lastPointerMask = 0; - } else if(event == InputEventType.MOUSE_MOVE) { - if(lastPointerMask != 0) - pointerMask = lastPointerMask; - } - + if (event == InputEventType.MOUSE_DOWN) { + if (code == 2) { + lastPointerMask |= 4; + } else if (code == 0) { + lastPointerMask |= 1; + } + } + + if (event == InputEventType.MOUSE_UP) { + if (code == 2) { + lastPointerMask ^= 4; + } else if (code == 0) { + lastPointerMask ^= 1; + } + } + sendModifierEvents(modifiers); - client.sendClientMouseEvent(pointerMask, x, y, code, modifiers); - if(pointerMask == 0) + client.sendClientMouseEvent(lastPointerMask, x, y, code, modifiers); + if(lastPointerMask == 0) sendModifierEvents(0); } diff --git a/core/src/com/cloud/agent/IAgentControl.java b/core/src/com/cloud/agent/IAgentControl.java index bb68d98a96d..fbf14cb1363 100644 --- a/core/src/com/cloud/agent/IAgentControl.java +++ b/core/src/com/cloud/agent/IAgentControl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent; diff --git a/core/src/com/cloud/agent/IAgentControlListener.java b/core/src/com/cloud/agent/IAgentControlListener.java index 775eff71437..4a6146e771f 100644 --- a/core/src/com/cloud/agent/IAgentControlListener.java +++ b/core/src/com/cloud/agent/IAgentControlListener.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent; import com.cloud.agent.api.AgentControlAnswer; diff --git a/core/src/com/cloud/agent/Listener.java b/core/src/com/cloud/agent/Listener.java index 0e826d44844..47b9bc3011d 100755 --- a/core/src/com/cloud/agent/Listener.java +++ b/core/src/com/cloud/agent/Listener.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent; import com.cloud.agent.api.AgentControlAnswer; diff --git a/core/src/com/cloud/agent/RecoveryHandler.java b/core/src/com/cloud/agent/RecoveryHandler.java index 4aa18c62a92..418c7b1034f 100644 --- a/core/src/com/cloud/agent/RecoveryHandler.java +++ b/core/src/com/cloud/agent/RecoveryHandler.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent; import com.cloud.agent.api.Command; diff --git a/core/src/com/cloud/agent/StartupCommandProcessor.java b/core/src/com/cloud/agent/StartupCommandProcessor.java index a6934657091..bc42cc308c5 100644 --- a/core/src/com/cloud/agent/StartupCommandProcessor.java +++ b/core/src/com/cloud/agent/StartupCommandProcessor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent; import com.cloud.agent.api.StartupCommand; diff --git a/core/src/com/cloud/agent/api/DirectNetworkUsageAnswer.java b/core/src/com/cloud/agent/api/DirectNetworkUsageAnswer.java index 18ebd556999..ae71bd66172 100644 --- a/core/src/com/cloud/agent/api/DirectNetworkUsageAnswer.java +++ b/core/src/com/cloud/agent/api/DirectNetworkUsageAnswer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; import java.util.HashMap; diff --git a/core/src/com/cloud/agent/api/DirectNetworkUsageCommand.java b/core/src/com/cloud/agent/api/DirectNetworkUsageCommand.java index 446057b504a..97dcf90177e 100644 --- a/core/src/com/cloud/agent/api/DirectNetworkUsageCommand.java +++ b/core/src/com/cloud/agent/api/DirectNetworkUsageCommand.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; import java.util.Date; diff --git a/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageAnswer.java b/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageAnswer.java index cbabb9036cc..e828583bbbc 100644 --- a/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageAnswer.java +++ b/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageAnswer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; import java.util.HashMap; diff --git a/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageCommand.java b/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageCommand.java index 7ea22c8d757..368eeaa98a5 100644 --- a/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageCommand.java +++ b/core/src/com/cloud/agent/api/ExternalNetworkResourceUsageCommand.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; public class ExternalNetworkResourceUsageCommand extends Command { diff --git a/core/src/com/cloud/agent/api/NetworkRulesSystemVmCommand.java b/core/src/com/cloud/agent/api/NetworkRulesSystemVmCommand.java index 678bcb30b06..9d2a532af08 100644 --- a/core/src/com/cloud/agent/api/NetworkRulesSystemVmCommand.java +++ b/core/src/com/cloud/agent/api/NetworkRulesSystemVmCommand.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; import com.cloud.vm.VirtualMachine; diff --git a/core/src/com/cloud/agent/api/RecurringNetworkUsageAnswer.java b/core/src/com/cloud/agent/api/RecurringNetworkUsageAnswer.java index 0fc3750112c..aa4cd3ab249 100644 --- a/core/src/com/cloud/agent/api/RecurringNetworkUsageAnswer.java +++ b/core/src/com/cloud/agent/api/RecurringNetworkUsageAnswer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; diff --git a/core/src/com/cloud/agent/api/RecurringNetworkUsageCommand.java b/core/src/com/cloud/agent/api/RecurringNetworkUsageCommand.java index 49e935b5586..7c653aa3a07 100644 --- a/core/src/com/cloud/agent/api/RecurringNetworkUsageCommand.java +++ b/core/src/com/cloud/agent/api/RecurringNetworkUsageCommand.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; diff --git a/core/src/com/cloud/agent/api/StartupVMMAgentCommand.java b/core/src/com/cloud/agent/api/StartupVMMAgentCommand.java index 5afd5c3cb87..3352a0b6cee 100644 --- a/core/src/com/cloud/agent/api/StartupVMMAgentCommand.java +++ b/core/src/com/cloud/agent/api/StartupVMMAgentCommand.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; import com.cloud.agent.api.Command; diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java index 876e3fe4a2c..33e297187fd 100755 --- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java +++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.resource.virtualnetwork; import java.io.BufferedReader; diff --git a/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java b/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java index 3873c0d109b..8eddc0328b7 100755 --- a/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java +++ b/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.transport; import java.lang.reflect.Array; diff --git a/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java b/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java index 582a053d0f0..7c76fa01512 100644 --- a/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java +++ b/core/src/com/cloud/agent/transport/LoggingExclusionStrategy.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.transport; import org.apache.log4j.Logger; diff --git a/core/src/com/cloud/agent/transport/Request.java b/core/src/com/cloud/agent/transport/Request.java index 35bc5647ce9..b0fa4cc2960 100755 --- a/core/src/com/cloud/agent/transport/Request.java +++ b/core/src/com/cloud/agent/transport/Request.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.transport; import java.io.ByteArrayInputStream; diff --git a/core/src/com/cloud/agent/transport/Response.java b/core/src/com/cloud/agent/transport/Response.java index 8d188407a2c..46bf48c0348 100755 --- a/core/src/com/cloud/agent/transport/Response.java +++ b/core/src/com/cloud/agent/transport/Response.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.transport; import com.cloud.agent.api.Answer; diff --git a/core/src/com/cloud/alert/AlertAdapter.java b/core/src/com/cloud/alert/AlertAdapter.java index 040f346c240..c04776ae56b 100644 --- a/core/src/com/cloud/alert/AlertAdapter.java +++ b/core/src/com/cloud/alert/AlertAdapter.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.alert; import com.cloud.utils.component.Adapter; diff --git a/core/src/com/cloud/alert/AlertManager.java b/core/src/com/cloud/alert/AlertManager.java index d9072d81b79..a24e18c8373 100755 --- a/core/src/com/cloud/alert/AlertManager.java +++ b/core/src/com/cloud/alert/AlertManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.alert; import com.cloud.capacity.CapacityVO; diff --git a/core/src/com/cloud/alert/AlertVO.java b/core/src/com/cloud/alert/AlertVO.java index 546d2145721..2399e7fd8ea 100755 --- a/core/src/com/cloud/alert/AlertVO.java +++ b/core/src/com/cloud/alert/AlertVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.alert; import java.util.Date; diff --git a/core/src/com/cloud/async/AsyncJobVO.java b/core/src/com/cloud/async/AsyncJobVO.java index b7a33f30c58..fc2cf5bccdf 100644 --- a/core/src/com/cloud/async/AsyncJobVO.java +++ b/core/src/com/cloud/async/AsyncJobVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.async; import java.util.Date; diff --git a/core/src/com/cloud/async/SyncQueueItemVO.java b/core/src/com/cloud/async/SyncQueueItemVO.java index 47f09084e44..f70ff852b5b 100644 --- a/core/src/com/cloud/async/SyncQueueItemVO.java +++ b/core/src/com/cloud/async/SyncQueueItemVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.async; import java.util.Date; diff --git a/core/src/com/cloud/async/SyncQueueVO.java b/core/src/com/cloud/async/SyncQueueVO.java index e855b7ddc20..741312f74dd 100644 --- a/core/src/com/cloud/async/SyncQueueVO.java +++ b/core/src/com/cloud/async/SyncQueueVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.async; import java.util.Date; diff --git a/core/src/com/cloud/capacity/CapacityVO.java b/core/src/com/cloud/capacity/CapacityVO.java index c862804b7dc..1bf06ce8205 100755 --- a/core/src/com/cloud/capacity/CapacityVO.java +++ b/core/src/com/cloud/capacity/CapacityVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.capacity; import javax.persistence.Transient; diff --git a/core/src/com/cloud/certificate/CertificateVO.java b/core/src/com/cloud/certificate/CertificateVO.java index dea72feaf1f..23c333146e7 100644 --- a/core/src/com/cloud/certificate/CertificateVO.java +++ b/core/src/com/cloud/certificate/CertificateVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.certificate; import javax.persistence.Column; diff --git a/core/src/com/cloud/configuration/ConfigurationVO.java b/core/src/com/cloud/configuration/ConfigurationVO.java index 2f144f2f7c1..6cd87b0da15 100644 --- a/core/src/com/cloud/configuration/ConfigurationVO.java +++ b/core/src/com/cloud/configuration/ConfigurationVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.configuration; import javax.persistence.Column; diff --git a/core/src/com/cloud/configuration/ResourceCountVO.java b/core/src/com/cloud/configuration/ResourceCountVO.java index bb2d52db178..7cf601e272a 100644 --- a/core/src/com/cloud/configuration/ResourceCountVO.java +++ b/core/src/com/cloud/configuration/ResourceCountVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.configuration; import javax.persistence.Column; diff --git a/core/src/com/cloud/configuration/ResourceLimitVO.java b/core/src/com/cloud/configuration/ResourceLimitVO.java index a62251a453d..ff5397e1950 100644 --- a/core/src/com/cloud/configuration/ResourceLimitVO.java +++ b/core/src/com/cloud/configuration/ResourceLimitVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.configuration; import javax.persistence.Column; diff --git a/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java b/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java index 7e11435d2c7..d6acf6d4cc1 100644 --- a/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java +++ b/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.consoleproxy; import java.util.List; diff --git a/core/src/com/cloud/event/EventVO.java b/core/src/com/cloud/event/EventVO.java index 0fbc502f7d2..79787888eba 100644 --- a/core/src/com/cloud/event/EventVO.java +++ b/core/src/com/cloud/event/EventVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event; import java.util.Date; diff --git a/core/src/com/cloud/event/UsageEvent.java b/core/src/com/cloud/event/UsageEvent.java index c349cf8b916..bf56f5e3fa9 100644 --- a/core/src/com/cloud/event/UsageEvent.java +++ b/core/src/com/cloud/event/UsageEvent.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event; import java.util.Date; diff --git a/core/src/com/cloud/event/UsageEventVO.java b/core/src/com/cloud/event/UsageEventVO.java index 1439226b550..201892facef 100644 --- a/core/src/com/cloud/event/UsageEventVO.java +++ b/core/src/com/cloud/event/UsageEventVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event; import java.util.Date; diff --git a/core/src/com/cloud/event/dao/EventDao.java b/core/src/com/cloud/event/dao/EventDao.java index fc532af4f87..bfcb818f20f 100644 --- a/core/src/com/cloud/event/dao/EventDao.java +++ b/core/src/com/cloud/event/dao/EventDao.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event.dao; import java.util.Date; diff --git a/core/src/com/cloud/event/dao/EventDaoImpl.java b/core/src/com/cloud/event/dao/EventDaoImpl.java index 722e5eb64d0..abeefbe4ffd 100644 --- a/core/src/com/cloud/event/dao/EventDaoImpl.java +++ b/core/src/com/cloud/event/dao/EventDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event.dao; import java.util.Date; diff --git a/core/src/com/cloud/event/dao/UsageEventDao.java b/core/src/com/cloud/event/dao/UsageEventDao.java index 80513d846ea..52fa01d0924 100644 --- a/core/src/com/cloud/event/dao/UsageEventDao.java +++ b/core/src/com/cloud/event/dao/UsageEventDao.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event.dao; import java.util.Date; diff --git a/core/src/com/cloud/event/dao/UsageEventDaoImpl.java b/core/src/com/cloud/event/dao/UsageEventDaoImpl.java index 37b99a3b74c..ea93d53e04b 100644 --- a/core/src/com/cloud/event/dao/UsageEventDaoImpl.java +++ b/core/src/com/cloud/event/dao/UsageEventDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.event.dao; import java.sql.PreparedStatement; diff --git a/core/src/com/cloud/exception/AgentControlChannelException.java b/core/src/com/cloud/exception/AgentControlChannelException.java index c71351b285c..50b84d42dae 100644 --- a/core/src/com/cloud/exception/AgentControlChannelException.java +++ b/core/src/com/cloud/exception/AgentControlChannelException.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.exception; import com.cloud.exception.CloudException; diff --git a/core/src/com/cloud/exception/OperationTimedoutException.java b/core/src/com/cloud/exception/OperationTimedoutException.java index d20ea7d3ba6..2eeec3780aa 100644 --- a/core/src/com/cloud/exception/OperationTimedoutException.java +++ b/core/src/com/cloud/exception/OperationTimedoutException.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.exception; import com.cloud.agent.api.Command; diff --git a/core/src/com/cloud/exception/UnsupportedVersionException.java b/core/src/com/cloud/exception/UnsupportedVersionException.java index 3e96c8fdb7b..616c7a841b2 100755 --- a/core/src/com/cloud/exception/UnsupportedVersionException.java +++ b/core/src/com/cloud/exception/UnsupportedVersionException.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.exception; import com.cloud.utils.SerialVersionUID; diff --git a/core/src/com/cloud/exception/UsageServerException.java b/core/src/com/cloud/exception/UsageServerException.java index 68fdd3f2bbd..68f83777b77 100644 --- a/core/src/com/cloud/exception/UsageServerException.java +++ b/core/src/com/cloud/exception/UsageServerException.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.exception; public class UsageServerException extends CloudException { diff --git a/core/src/com/cloud/host/DetailVO.java b/core/src/com/cloud/host/DetailVO.java index c98af7f9249..d7ee8142c5a 100644 --- a/core/src/com/cloud/host/DetailVO.java +++ b/core/src/com/cloud/host/DetailVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.host; import javax.persistence.Column; diff --git a/core/src/com/cloud/host/HostInfo.java b/core/src/com/cloud/host/HostInfo.java index 5928aefad90..e19b50f3874 100644 --- a/core/src/com/cloud/host/HostInfo.java +++ b/core/src/com/cloud/host/HostInfo.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.host; /** diff --git a/core/src/com/cloud/host/HostTagVO.java b/core/src/com/cloud/host/HostTagVO.java index 600fb6dc5af..7164d10df0c 100644 --- a/core/src/com/cloud/host/HostTagVO.java +++ b/core/src/com/cloud/host/HostTagVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.host; import javax.persistence.Column; diff --git a/core/src/com/cloud/host/HostVO.java b/core/src/com/cloud/host/HostVO.java index e339c20a3ae..dab9768a943 100755 --- a/core/src/com/cloud/host/HostVO.java +++ b/core/src/com/cloud/host/HostVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.host; import java.util.Date; diff --git a/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java b/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java index 04dc1d952f8..33cafbc92d9 100644 --- a/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java +++ b/core/src/com/cloud/hypervisor/HypervisorCapabilitiesVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor; import java.util.UUID; diff --git a/core/src/com/cloud/hypervisor/hyperv/resource/HypervDummyResourceBase.java b/core/src/com/cloud/hypervisor/hyperv/resource/HypervDummyResourceBase.java index 1ec0ec5b3c6..6e52924db28 100644 --- a/core/src/com/cloud/hypervisor/hyperv/resource/HypervDummyResourceBase.java +++ b/core/src/com/cloud/hypervisor/hyperv/resource/HypervDummyResourceBase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor.hyperv.resource; import com.cloud.agent.api.Answer; diff --git a/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java b/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java index 6f47b547182..ede6301d9c3 100755 --- a/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java +++ b/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor.hyperv.resource; import java.io.BufferedInputStream; @@ -96,7 +100,7 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.api.to.VolumeTO; import com.cloud.host.Host.Type; import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.hypervisor.vmware.resource.SshHelper; +import com.cloud.utils.ssh.SshHelper; import com.cloud.resource.ServerResource; import com.cloud.resource.ServerResourceBase; import com.cloud.serializer.GsonHelper; diff --git a/core/src/com/cloud/hypervisor/kvm/resource/KvmDummyResourceBase.java b/core/src/com/cloud/hypervisor/kvm/resource/KvmDummyResourceBase.java index af28aedb707..d49780f60bb 100644 --- a/core/src/com/cloud/hypervisor/kvm/resource/KvmDummyResourceBase.java +++ b/core/src/com/cloud/hypervisor/kvm/resource/KvmDummyResourceBase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor.kvm.resource; import java.util.HashMap; diff --git a/core/src/com/cloud/info/ConsoleProxyConnectionInfo.java b/core/src/com/cloud/info/ConsoleProxyConnectionInfo.java index ae2c5519cf9..f16a14db6d2 100644 --- a/core/src/com/cloud/info/ConsoleProxyConnectionInfo.java +++ b/core/src/com/cloud/info/ConsoleProxyConnectionInfo.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; public class ConsoleProxyConnectionInfo { diff --git a/core/src/com/cloud/info/ConsoleProxyInfo.java b/core/src/com/cloud/info/ConsoleProxyInfo.java index 52155b7c5ae..3439f3d3bfa 100644 --- a/core/src/com/cloud/info/ConsoleProxyInfo.java +++ b/core/src/com/cloud/info/ConsoleProxyInfo.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; public class ConsoleProxyInfo { diff --git a/core/src/com/cloud/info/ConsoleProxyLoadInfo.java b/core/src/com/cloud/info/ConsoleProxyLoadInfo.java index c89f33cdafe..a3ec3e37c8d 100644 --- a/core/src/com/cloud/info/ConsoleProxyLoadInfo.java +++ b/core/src/com/cloud/info/ConsoleProxyLoadInfo.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; public class ConsoleProxyLoadInfo { diff --git a/core/src/com/cloud/info/ConsoleProxyStatus.java b/core/src/com/cloud/info/ConsoleProxyStatus.java index a9a64f0453c..08e7db84920 100644 --- a/core/src/com/cloud/info/ConsoleProxyStatus.java +++ b/core/src/com/cloud/info/ConsoleProxyStatus.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; public class ConsoleProxyStatus { diff --git a/core/src/com/cloud/info/RunningHostCountInfo.java b/core/src/com/cloud/info/RunningHostCountInfo.java index 26b6e7e1f03..f77a4dc3036 100644 --- a/core/src/com/cloud/info/RunningHostCountInfo.java +++ b/core/src/com/cloud/info/RunningHostCountInfo.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; public class RunningHostCountInfo { diff --git a/core/src/com/cloud/info/RunningHostInfoAgregator.java b/core/src/com/cloud/info/RunningHostInfoAgregator.java index 7da9e2a3097..f6c7128f0a3 100644 --- a/core/src/com/cloud/info/RunningHostInfoAgregator.java +++ b/core/src/com/cloud/info/RunningHostInfoAgregator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; import java.util.HashMap; diff --git a/core/src/com/cloud/info/SecStorageVmLoadInfo.java b/core/src/com/cloud/info/SecStorageVmLoadInfo.java index 95c30576a11..e14403ad321 100644 --- a/core/src/com/cloud/info/SecStorageVmLoadInfo.java +++ b/core/src/com/cloud/info/SecStorageVmLoadInfo.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.info; public class SecStorageVmLoadInfo { diff --git a/core/src/com/cloud/network/HAProxyConfigurator.java b/core/src/com/cloud/network/HAProxyConfigurator.java index 36300710687..1cd25b17e7a 100644 --- a/core/src/com/cloud/network/HAProxyConfigurator.java +++ b/core/src/com/cloud/network/HAProxyConfigurator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network; import java.util.ArrayList; diff --git a/core/src/com/cloud/network/LoadBalancerConfigurator.java b/core/src/com/cloud/network/LoadBalancerConfigurator.java index a5bc66504fc..5dd98810ed0 100644 --- a/core/src/com/cloud/network/LoadBalancerConfigurator.java +++ b/core/src/com/cloud/network/LoadBalancerConfigurator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network; import java.util.List; diff --git a/core/src/com/cloud/network/LoadBalancerValidator.java b/core/src/com/cloud/network/LoadBalancerValidator.java index 4bdf06d5c3d..3fb8a2f89ab 100644 --- a/core/src/com/cloud/network/LoadBalancerValidator.java +++ b/core/src/com/cloud/network/LoadBalancerValidator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network; import com.cloud.exception.ResourceUnavailableException; diff --git a/core/src/com/cloud/network/VpnUserVO.java b/core/src/com/cloud/network/VpnUserVO.java index dc996ba0bf6..8b2dc051199 100644 --- a/core/src/com/cloud/network/VpnUserVO.java +++ b/core/src/com/cloud/network/VpnUserVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network; import java.util.UUID; diff --git a/core/src/com/cloud/network/resource/CreateLoadBalancerApplianceAnswer.java b/core/src/com/cloud/network/resource/CreateLoadBalancerApplianceAnswer.java index 440f66f834b..6e20ccd0ac2 100644 --- a/core/src/com/cloud/network/resource/CreateLoadBalancerApplianceAnswer.java +++ b/core/src/com/cloud/network/resource/CreateLoadBalancerApplianceAnswer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.resource; import com.cloud.agent.api.Answer; diff --git a/core/src/com/cloud/network/resource/DestroyLoadBalancerApplianceAnswer.java b/core/src/com/cloud/network/resource/DestroyLoadBalancerApplianceAnswer.java index c47c1988213..29c9ca01a79 100644 --- a/core/src/com/cloud/network/resource/DestroyLoadBalancerApplianceAnswer.java +++ b/core/src/com/cloud/network/resource/DestroyLoadBalancerApplianceAnswer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.resource; import com.cloud.agent.api.Answer; diff --git a/core/src/com/cloud/network/resource/TrafficSentinelResource.java b/core/src/com/cloud/network/resource/TrafficSentinelResource.java index e7da109912d..a9088d0eb67 100644 --- a/core/src/com/cloud/network/resource/TrafficSentinelResource.java +++ b/core/src/com/cloud/network/resource/TrafficSentinelResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.resource; import java.io.BufferedReader; diff --git a/core/src/com/cloud/network/resource/XTrustProvider.java b/core/src/com/cloud/network/resource/XTrustProvider.java index ec76b6bef5f..dd9523e2c1c 100644 --- a/core/src/com/cloud/network/resource/XTrustProvider.java +++ b/core/src/com/cloud/network/resource/XTrustProvider.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * The contents of this file are subject to the "END USER LICENSE AGREEMENT FOR F5 * Software Development Kit for iControl"; you may not use this file except in diff --git a/core/src/com/cloud/network/security/SecurityGroupRuleVO.java b/core/src/com/cloud/network/security/SecurityGroupRuleVO.java index ef97f74d472..7d38af853db 100644 --- a/core/src/com/cloud/network/security/SecurityGroupRuleVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupRuleVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; import java.util.UUID; diff --git a/core/src/com/cloud/network/security/SecurityGroupRulesVO.java b/core/src/com/cloud/network/security/SecurityGroupRulesVO.java index c5fc82c07b1..56353da8e5a 100644 --- a/core/src/com/cloud/network/security/SecurityGroupRulesVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupRulesVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; import javax.persistence.Column; diff --git a/core/src/com/cloud/network/security/SecurityGroupVMMapVO.java b/core/src/com/cloud/network/security/SecurityGroupVMMapVO.java index bcdba9fd0c1..e3dd28108c8 100644 --- a/core/src/com/cloud/network/security/SecurityGroupVMMapVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupVMMapVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; import javax.persistence.Column; diff --git a/core/src/com/cloud/network/security/SecurityGroupVO.java b/core/src/com/cloud/network/security/SecurityGroupVO.java index e9f2f7e5449..b059e8c67f1 100644 --- a/core/src/com/cloud/network/security/SecurityGroupVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; import java.util.UUID; diff --git a/core/src/com/cloud/network/security/SecurityGroupWork.java b/core/src/com/cloud/network/security/SecurityGroupWork.java index b6178b6a6df..a7f89561174 100644 --- a/core/src/com/cloud/network/security/SecurityGroupWork.java +++ b/core/src/com/cloud/network/security/SecurityGroupWork.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; /** diff --git a/core/src/com/cloud/network/security/SecurityGroupWorkVO.java b/core/src/com/cloud/network/security/SecurityGroupWorkVO.java index 2a35b07aa71..b0c8ef3a463 100644 --- a/core/src/com/cloud/network/security/SecurityGroupWorkVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupWorkVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; import java.util.Date; diff --git a/core/src/com/cloud/network/security/VmRulesetLogVO.java b/core/src/com/cloud/network/security/VmRulesetLogVO.java index 2b65389d017..709a3c97cd9 100644 --- a/core/src/com/cloud/network/security/VmRulesetLogVO.java +++ b/core/src/com/cloud/network/security/VmRulesetLogVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.security; import java.util.Date; diff --git a/core/src/com/cloud/resource/DiskPreparer.java b/core/src/com/cloud/resource/DiskPreparer.java index 5d093bfb3ab..77b8f7c1b7f 100644 --- a/core/src/com/cloud/resource/DiskPreparer.java +++ b/core/src/com/cloud/resource/DiskPreparer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource; import com.cloud.storage.VolumeVO; diff --git a/core/src/com/cloud/resource/NetworkPreparer.java b/core/src/com/cloud/resource/NetworkPreparer.java index 23a05adff75..d7034535e9f 100644 --- a/core/src/com/cloud/resource/NetworkPreparer.java +++ b/core/src/com/cloud/resource/NetworkPreparer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource; import com.cloud.utils.component.Adapter; diff --git a/core/src/com/cloud/resource/ResourceListener.java b/core/src/com/cloud/resource/ResourceListener.java index febfc254439..0efea12aee5 100755 --- a/core/src/com/cloud/resource/ResourceListener.java +++ b/core/src/com/cloud/resource/ResourceListener.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource; import java.net.URI; diff --git a/core/src/com/cloud/resource/ServerResource.java b/core/src/com/cloud/resource/ServerResource.java index 8e44ff8da25..62b908ba728 100755 --- a/core/src/com/cloud/resource/ServerResource.java +++ b/core/src/com/cloud/resource/ServerResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource; import com.cloud.agent.IAgentControl; diff --git a/core/src/com/cloud/resource/ServerResourceBase.java b/core/src/com/cloud/resource/ServerResourceBase.java index 65f4ac6d45d..9449b058556 100755 --- a/core/src/com/cloud/resource/ServerResourceBase.java +++ b/core/src/com/cloud/resource/ServerResourceBase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource; import java.io.PrintWriter; diff --git a/core/src/com/cloud/resource/UnableDeleteHostException.java b/core/src/com/cloud/resource/UnableDeleteHostException.java index 0641cf2b5de..154147c3c97 100755 --- a/core/src/com/cloud/resource/UnableDeleteHostException.java +++ b/core/src/com/cloud/resource/UnableDeleteHostException.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource; import com.cloud.utils.SerialVersionUID; diff --git a/core/src/com/cloud/resource/hypervisor/HypervisorResource.java b/core/src/com/cloud/resource/hypervisor/HypervisorResource.java index 849c3b538c8..ce4c219f88b 100644 --- a/core/src/com/cloud/resource/hypervisor/HypervisorResource.java +++ b/core/src/com/cloud/resource/hypervisor/HypervisorResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource.hypervisor; import com.cloud.agent.api.RebootAnswer; diff --git a/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java b/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java index 5d2e874d321..65297a39b96 100644 --- a/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java +++ b/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.resource.storage; import com.cloud.agent.api.storage.CreateAnswer; diff --git a/core/src/com/cloud/serializer/GsonHelper.java b/core/src/com/cloud/serializer/GsonHelper.java index d3954586ce2..8b2dcb0e928 100644 --- a/core/src/com/cloud/serializer/GsonHelper.java +++ b/core/src/com/cloud/serializer/GsonHelper.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.serializer; diff --git a/core/src/com/cloud/serializer/SerializerHelper.java b/core/src/com/cloud/serializer/SerializerHelper.java index 8c6d9023874..dd858b79223 100644 --- a/core/src/com/cloud/serializer/SerializerHelper.java +++ b/core/src/com/cloud/serializer/SerializerHelper.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.serializer; import java.lang.reflect.Field; diff --git a/core/src/com/cloud/storage/DiskOfferingVO.java b/core/src/com/cloud/storage/DiskOfferingVO.java index a58f363a18f..02198407ba6 100755 --- a/core/src/com/cloud/storage/DiskOfferingVO.java +++ b/core/src/com/cloud/storage/DiskOfferingVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/GuestOSCategoryVO.java b/core/src/com/cloud/storage/GuestOSCategoryVO.java index d2a17215650..cbe242eef5d 100644 --- a/core/src/com/cloud/storage/GuestOSCategoryVO.java +++ b/core/src/com/cloud/storage/GuestOSCategoryVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.UUID; diff --git a/core/src/com/cloud/storage/GuestOSVO.java b/core/src/com/cloud/storage/GuestOSVO.java index b2440a31910..85db94e29f6 100644 --- a/core/src/com/cloud/storage/GuestOSVO.java +++ b/core/src/com/cloud/storage/GuestOSVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.UUID; diff --git a/core/src/com/cloud/storage/JavaStorageLayer.java b/core/src/com/cloud/storage/JavaStorageLayer.java index efadb7cba27..c4aa74a25ce 100644 --- a/core/src/com/cloud/storage/JavaStorageLayer.java +++ b/core/src/com/cloud/storage/JavaStorageLayer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.io.File; diff --git a/core/src/com/cloud/storage/LaunchPermissionVO.java b/core/src/com/cloud/storage/LaunchPermissionVO.java index a367d451009..8bfe09d3719 100644 --- a/core/src/com/cloud/storage/LaunchPermissionVO.java +++ b/core/src/com/cloud/storage/LaunchPermissionVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import javax.persistence.Column; diff --git a/core/src/com/cloud/storage/SecondaryStorage.java b/core/src/com/cloud/storage/SecondaryStorage.java index 2ebc793d595..dc01642767f 100644 --- a/core/src/com/cloud/storage/SecondaryStorage.java +++ b/core/src/com/cloud/storage/SecondaryStorage.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; public interface SecondaryStorage { diff --git a/core/src/com/cloud/storage/SecondaryStorageLayer.java b/core/src/com/cloud/storage/SecondaryStorageLayer.java index 91f37e6b70e..539733d3531 100644 --- a/core/src/com/cloud/storage/SecondaryStorageLayer.java +++ b/core/src/com/cloud/storage/SecondaryStorageLayer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.net.URI; diff --git a/core/src/com/cloud/storage/SnapshotPolicyVO.java b/core/src/com/cloud/storage/SnapshotPolicyVO.java index 4a42ad35e76..d059fcbc6da 100644 --- a/core/src/com/cloud/storage/SnapshotPolicyVO.java +++ b/core/src/com/cloud/storage/SnapshotPolicyVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.UUID; diff --git a/core/src/com/cloud/storage/SnapshotScheduleVO.java b/core/src/com/cloud/storage/SnapshotScheduleVO.java index 96c6252c89f..80216e48a55 100644 --- a/core/src/com/cloud/storage/SnapshotScheduleVO.java +++ b/core/src/com/cloud/storage/SnapshotScheduleVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/SnapshotVO.java b/core/src/com/cloud/storage/SnapshotVO.java index 24a5c9e88d7..08dfafa6bac 100644 --- a/core/src/com/cloud/storage/SnapshotVO.java +++ b/core/src/com/cloud/storage/SnapshotVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/StorageLayer.java b/core/src/com/cloud/storage/StorageLayer.java index 6f92bceb12f..b640191f940 100644 --- a/core/src/com/cloud/storage/StorageLayer.java +++ b/core/src/com/cloud/storage/StorageLayer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.io.File; diff --git a/core/src/com/cloud/storage/StoragePoolDetailVO.java b/core/src/com/cloud/storage/StoragePoolDetailVO.java index f9ce3e3efa0..2e1af7b6dab 100644 --- a/core/src/com/cloud/storage/StoragePoolDetailVO.java +++ b/core/src/com/cloud/storage/StoragePoolDetailVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import javax.persistence.Column; diff --git a/core/src/com/cloud/storage/StoragePoolDiscoverer.java b/core/src/com/cloud/storage/StoragePoolDiscoverer.java index 5c11524705a..816e899f941 100644 --- a/core/src/com/cloud/storage/StoragePoolDiscoverer.java +++ b/core/src/com/cloud/storage/StoragePoolDiscoverer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.net.URI; diff --git a/core/src/com/cloud/storage/StoragePoolHostAssoc.java b/core/src/com/cloud/storage/StoragePoolHostAssoc.java index bdc4e854fb9..c3b079a0ed4 100644 --- a/core/src/com/cloud/storage/StoragePoolHostAssoc.java +++ b/core/src/com/cloud/storage/StoragePoolHostAssoc.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/StoragePoolHostVO.java b/core/src/com/cloud/storage/StoragePoolHostVO.java index b5a4d124694..ce72951e85b 100644 --- a/core/src/com/cloud/storage/StoragePoolHostVO.java +++ b/core/src/com/cloud/storage/StoragePoolHostVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/StoragePoolVO.java b/core/src/com/cloud/storage/StoragePoolVO.java index 526fecfd133..b1f02019af1 100644 --- a/core/src/com/cloud/storage/StoragePoolVO.java +++ b/core/src/com/cloud/storage/StoragePoolVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/StoragePoolWorkVO.java b/core/src/com/cloud/storage/StoragePoolWorkVO.java index 53decd48306..c5101eabb85 100644 --- a/core/src/com/cloud/storage/StoragePoolWorkVO.java +++ b/core/src/com/cloud/storage/StoragePoolWorkVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import javax.persistence.Column; diff --git a/core/src/com/cloud/storage/SwiftVO.java b/core/src/com/cloud/storage/SwiftVO.java index ea6672eaec8..7e07629e72b 100644 --- a/core/src/com/cloud/storage/SwiftVO.java +++ b/core/src/com/cloud/storage/SwiftVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/UploadVO.java b/core/src/com/cloud/storage/UploadVO.java index 3758a9802a5..45fd9216835 100755 --- a/core/src/com/cloud/storage/UploadVO.java +++ b/core/src/com/cloud/storage/UploadVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/VMTemplateDetailVO.java b/core/src/com/cloud/storage/VMTemplateDetailVO.java index 312dcdbc14e..e3f7487460f 100644 --- a/core/src/com/cloud/storage/VMTemplateDetailVO.java +++ b/core/src/com/cloud/storage/VMTemplateDetailVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import javax.persistence.Column; diff --git a/core/src/com/cloud/storage/VMTemplateHostVO.java b/core/src/com/cloud/storage/VMTemplateHostVO.java index 25e015a727d..4d94a29b024 100755 --- a/core/src/com/cloud/storage/VMTemplateHostVO.java +++ b/core/src/com/cloud/storage/VMTemplateHostVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/VMTemplateStoragePoolVO.java b/core/src/com/cloud/storage/VMTemplateStoragePoolVO.java index 37fe15a69ee..ed79bb914ac 100644 --- a/core/src/com/cloud/storage/VMTemplateStoragePoolVO.java +++ b/core/src/com/cloud/storage/VMTemplateStoragePoolVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/VMTemplateSwiftVO.java b/core/src/com/cloud/storage/VMTemplateSwiftVO.java index 921bdffbadd..a009e237943 100755 --- a/core/src/com/cloud/storage/VMTemplateSwiftVO.java +++ b/core/src/com/cloud/storage/VMTemplateSwiftVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/VMTemplateVO.java b/core/src/com/cloud/storage/VMTemplateVO.java index ee147320791..cd17bc9bf5a 100755 --- a/core/src/com/cloud/storage/VMTemplateVO.java +++ b/core/src/com/cloud/storage/VMTemplateVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/VMTemplateZoneVO.java b/core/src/com/cloud/storage/VMTemplateZoneVO.java index b423985abe0..e7169b8cdae 100644 --- a/core/src/com/cloud/storage/VMTemplateZoneVO.java +++ b/core/src/com/cloud/storage/VMTemplateZoneVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/VolumeHostVO.java b/core/src/com/cloud/storage/VolumeHostVO.java index 3bba4e18d6e..d8d567004b0 100755 --- a/core/src/com/cloud/storage/VolumeHostVO.java +++ b/core/src/com/cloud/storage/VolumeHostVO.java @@ -1,296 +1,312 @@ -package com.cloud.storage; - -import java.util.Date; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -//import com.cloud.storage.VMVolumeStorageResourceAssoc.Status; -import com.cloud.storage.Storage.ImageFormat; -import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; -import com.cloud.utils.db.GenericDaoBase; - -/** - * Join table for storage hosts and volumes - * @author Nitin - * - */ -@Entity -@Table(name="volume_host_ref") -public class VolumeHostVO { - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - Long id; - - @Column(name="host_id") - private long hostId; - - @Column(name="volume_id") - private long volumeId; - - @Column(name="zone_id") - private long zoneId; - - @Column(name=GenericDaoBase.CREATED_COLUMN) - private Date created = null; - - @Column(name="last_updated") - @Temporal(value=TemporalType.TIMESTAMP) - private Date lastUpdated = null; - - @Column (name="download_pct") - private int downloadPercent; - - @Column (name="size") - private long size; - - @Column (name="physical_size") - private long physicalSize; - - @Column (name="download_state") - @Enumerated(EnumType.STRING) - private Status downloadState; - - @Column(name="checksum") - private String checksum; - - @Column (name="local_path") - private String localDownloadPath; - - @Column (name="error_str") - private String errorString; - - @Column (name="job_id") - private String jobId; - - @Column (name="install_path") - private String installPath; - - @Column (name="url") - private String downloadUrl; - - @Column(name="format") - private Storage.ImageFormat format; - - @Column(name="destroyed") - boolean destroyed = false; - - - public String getInstallPath() { - return installPath; - } - - public long getHostId() { - return hostId; - } - - public void setHostId(long hostId) { - this.hostId = hostId; - } - - - public long getVolumeId() { - return volumeId; - } - - - public void setVolumeId(long volumeId) { - this.volumeId = volumeId; - } - - - public long getZoneId() { - return zoneId; - } - - public void setZoneId(long zoneId) { - this.zoneId = zoneId; - } - - public int getDownloadPercent() { - return downloadPercent; - } - - - public void setDownloadPercent(int downloadPercent) { - this.downloadPercent = downloadPercent; - } - - - public void setDownloadState(Status downloadState) { - this.downloadState = downloadState; - } - - - public long getId() { - return id; - } - - - public Date getCreated() { - return created; - } - - - public Date getLastUpdated() { - return lastUpdated; - } - - - public void setLastUpdated(Date date) { - lastUpdated = date; - } - - - public void setInstallPath(String installPath) { - this.installPath = installPath; - } - - - public Status getDownloadState() { - return downloadState; - } - - public String getChecksum() { - return checksum; - } - - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - public VolumeHostVO(long hostId, long volumeId) { - super(); - this.hostId = hostId; - this.volumeId = volumeId; - } - - public VolumeHostVO(long hostId, long volumeId, long zoneId, Date lastUpdated, - int downloadPercent, Status downloadState, - String localDownloadPath, String errorString, String jobId, - String installPath, String downloadUrl, String checksum, ImageFormat format) { - //super(); - this.hostId = hostId; - this.volumeId = volumeId; - this.zoneId = zoneId; - this.lastUpdated = lastUpdated; - this.downloadPercent = downloadPercent; - this.downloadState = downloadState; - this.localDownloadPath = localDownloadPath; - this.errorString = errorString; - this.jobId = jobId; - this.installPath = installPath; - this.setDownloadUrl(downloadUrl); - this.checksum = checksum; - this.format = format; - } - - protected VolumeHostVO() { - - } - - - public void setLocalDownloadPath(String localPath) { - this.localDownloadPath = localPath; - } - - - public String getLocalDownloadPath() { - return localDownloadPath; - } - - - public void setErrorString(String errorString) { - this.errorString = errorString; - } - - - public String getErrorString() { - return errorString; - } - - - public void setJobId(String jobId) { - this.jobId = jobId; - } - - - public String getJobId() { - return jobId; - } - - - public boolean equals(Object obj) { - if (obj instanceof VolumeHostVO) { - VolumeHostVO other = (VolumeHostVO)obj; - return (this.volumeId==other.getVolumeId() && this.hostId==other.getHostId()); - } - return false; - } - - - public int hashCode() { - Long tid = new Long(volumeId); - Long hid = new Long(hostId); - return tid.hashCode()+hid.hashCode(); - } - - public void setSize(long size) { - this.size = size; - } - - public long getSize() { - return size; - } - - - public void setPhysicalSize(long physicalSize) { - this.physicalSize = physicalSize; - } - - public long getPhysicalSize() { - return physicalSize; - } - - public void setDestroyed(boolean destroyed) { - this.destroyed = destroyed; - } - - public boolean getDestroyed() { - return destroyed; - } - - public void setDownloadUrl(String downloadUrl) { - this.downloadUrl = downloadUrl; - } - - public String getDownloadUrl() { - return downloadUrl; - } - - public Storage.ImageFormat getFormat() { - return format; - } - - public void setFormat(Storage.ImageFormat format) { - this.format = format; - } - - public long getVolumeSize() { - return -1; - } - - - public String toString() { - return new StringBuilder("VolumeHost[").append(id).append("-").append(volumeId).append("-").append(hostId).append(installPath).append("]").toString(); - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.storage; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +//import com.cloud.storage.VMVolumeStorageResourceAssoc.Status; +import com.cloud.storage.Storage.ImageFormat; +import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; +import com.cloud.utils.db.GenericDaoBase; + +/** + * Join table for storage hosts and volumes + * @author Nitin + * + */ +@Entity +@Table(name="volume_host_ref") +public class VolumeHostVO { + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + Long id; + + @Column(name="host_id") + private long hostId; + + @Column(name="volume_id") + private long volumeId; + + @Column(name="zone_id") + private long zoneId; + + @Column(name=GenericDaoBase.CREATED_COLUMN) + private Date created = null; + + @Column(name="last_updated") + @Temporal(value=TemporalType.TIMESTAMP) + private Date lastUpdated = null; + + @Column (name="download_pct") + private int downloadPercent; + + @Column (name="size") + private long size; + + @Column (name="physical_size") + private long physicalSize; + + @Column (name="download_state") + @Enumerated(EnumType.STRING) + private Status downloadState; + + @Column(name="checksum") + private String checksum; + + @Column (name="local_path") + private String localDownloadPath; + + @Column (name="error_str") + private String errorString; + + @Column (name="job_id") + private String jobId; + + @Column (name="install_path") + private String installPath; + + @Column (name="url") + private String downloadUrl; + + @Column(name="format") + private Storage.ImageFormat format; + + @Column(name="destroyed") + boolean destroyed = false; + + + public String getInstallPath() { + return installPath; + } + + public long getHostId() { + return hostId; + } + + public void setHostId(long hostId) { + this.hostId = hostId; + } + + + public long getVolumeId() { + return volumeId; + } + + + public void setVolumeId(long volumeId) { + this.volumeId = volumeId; + } + + + public long getZoneId() { + return zoneId; + } + + public void setZoneId(long zoneId) { + this.zoneId = zoneId; + } + + public int getDownloadPercent() { + return downloadPercent; + } + + + public void setDownloadPercent(int downloadPercent) { + this.downloadPercent = downloadPercent; + } + + + public void setDownloadState(Status downloadState) { + this.downloadState = downloadState; + } + + + public long getId() { + return id; + } + + + public Date getCreated() { + return created; + } + + + public Date getLastUpdated() { + return lastUpdated; + } + + + public void setLastUpdated(Date date) { + lastUpdated = date; + } + + + public void setInstallPath(String installPath) { + this.installPath = installPath; + } + + + public Status getDownloadState() { + return downloadState; + } + + public String getChecksum() { + return checksum; + } + + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + public VolumeHostVO(long hostId, long volumeId) { + super(); + this.hostId = hostId; + this.volumeId = volumeId; + } + + public VolumeHostVO(long hostId, long volumeId, long zoneId, Date lastUpdated, + int downloadPercent, Status downloadState, + String localDownloadPath, String errorString, String jobId, + String installPath, String downloadUrl, String checksum, ImageFormat format) { + //super(); + this.hostId = hostId; + this.volumeId = volumeId; + this.zoneId = zoneId; + this.lastUpdated = lastUpdated; + this.downloadPercent = downloadPercent; + this.downloadState = downloadState; + this.localDownloadPath = localDownloadPath; + this.errorString = errorString; + this.jobId = jobId; + this.installPath = installPath; + this.setDownloadUrl(downloadUrl); + this.checksum = checksum; + this.format = format; + } + + protected VolumeHostVO() { + + } + + + public void setLocalDownloadPath(String localPath) { + this.localDownloadPath = localPath; + } + + + public String getLocalDownloadPath() { + return localDownloadPath; + } + + + public void setErrorString(String errorString) { + this.errorString = errorString; + } + + + public String getErrorString() { + return errorString; + } + + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + + public String getJobId() { + return jobId; + } + + + public boolean equals(Object obj) { + if (obj instanceof VolumeHostVO) { + VolumeHostVO other = (VolumeHostVO)obj; + return (this.volumeId==other.getVolumeId() && this.hostId==other.getHostId()); + } + return false; + } + + + public int hashCode() { + Long tid = new Long(volumeId); + Long hid = new Long(hostId); + return tid.hashCode()+hid.hashCode(); + } + + public void setSize(long size) { + this.size = size; + } + + public long getSize() { + return size; + } + + + public void setPhysicalSize(long physicalSize) { + this.physicalSize = physicalSize; + } + + public long getPhysicalSize() { + return physicalSize; + } + + public void setDestroyed(boolean destroyed) { + this.destroyed = destroyed; + } + + public boolean getDestroyed() { + return destroyed; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public Storage.ImageFormat getFormat() { + return format; + } + + public void setFormat(Storage.ImageFormat format) { + this.format = format; + } + + public long getVolumeSize() { + return -1; + } + + + public String toString() { + return new StringBuilder("VolumeHost[").append(id).append("-").append(volumeId).append("-").append(hostId).append(installPath).append("]").toString(); + } + +} diff --git a/core/src/com/cloud/storage/VolumeVO.java b/core/src/com/cloud/storage/VolumeVO.java index d8fece1166d..ef0fedaf651 100755 --- a/core/src/com/cloud/storage/VolumeVO.java +++ b/core/src/com/cloud/storage/VolumeVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage; import java.util.Date; diff --git a/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java index 91df10dca6f..c606fca1fbf 100755 --- a/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java +++ b/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.resource; import java.io.File; diff --git a/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java index bb12b9a1522..d9c69f8b151 100644 --- a/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java +++ b/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.resource; import java.util.HashMap; diff --git a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java index 03ce87ad75e..a0873abbf95 100755 --- a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java +++ b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.resource; import java.io.BufferedWriter; diff --git a/core/src/com/cloud/storage/resource/SecondaryStorageResource.java b/core/src/com/cloud/storage/resource/SecondaryStorageResource.java index 41e2690c420..37c6686afd8 100755 --- a/core/src/com/cloud/storage/resource/SecondaryStorageResource.java +++ b/core/src/com/cloud/storage/resource/SecondaryStorageResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.resource; import com.cloud.agent.api.storage.ssCommand; import com.cloud.resource.ServerResource; diff --git a/core/src/com/cloud/storage/resource/SecondaryStorageResourceHandler.java b/core/src/com/cloud/storage/resource/SecondaryStorageResourceHandler.java index 1707a4d2842..28b96b621ed 100644 --- a/core/src/com/cloud/storage/resource/SecondaryStorageResourceHandler.java +++ b/core/src/com/cloud/storage/resource/SecondaryStorageResourceHandler.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.resource; import com.cloud.agent.api.Answer; diff --git a/core/src/com/cloud/storage/resource/StoragePoolResource.java b/core/src/com/cloud/storage/resource/StoragePoolResource.java index 0ecdec380df..5d352b0b651 100644 --- a/core/src/com/cloud/storage/resource/StoragePoolResource.java +++ b/core/src/com/cloud/storage/resource/StoragePoolResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.resource; import com.cloud.agent.api.Answer; diff --git a/core/src/com/cloud/storage/snapshot/SnapshotSchedule.java b/core/src/com/cloud/storage/snapshot/SnapshotSchedule.java index e16e90fe294..f5f810a9be1 100644 --- a/core/src/com/cloud/storage/snapshot/SnapshotSchedule.java +++ b/core/src/com/cloud/storage/snapshot/SnapshotSchedule.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.snapshot; import java.util.Date; diff --git a/core/src/com/cloud/storage/template/DownloadManager.java b/core/src/com/cloud/storage/template/DownloadManager.java index fe841f81b9d..27d7f659706 100644 --- a/core/src/com/cloud/storage/template/DownloadManager.java +++ b/core/src/com/cloud/storage/template/DownloadManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.util.List; diff --git a/core/src/com/cloud/storage/template/DownloadManagerImpl.java b/core/src/com/cloud/storage/template/DownloadManagerImpl.java index b9fc038dca6..cd4b30d37ba 100755 --- a/core/src/com/cloud/storage/template/DownloadManagerImpl.java +++ b/core/src/com/cloud/storage/template/DownloadManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.BufferedReader; @@ -293,7 +297,7 @@ public class DownloadManagerImpl implements DownloadManager { } byte[] md5sum = digest.digest(); BigInteger bigInt = new BigInteger(1, md5sum); - checksum = String.format("%032x",bigInt.toString(16)); + checksum = String.format("%032x",bigInt); return checksum; }catch(IOException e) { return null; diff --git a/core/src/com/cloud/storage/template/FtpTemplateUploader.java b/core/src/com/cloud/storage/template/FtpTemplateUploader.java index 0df85c0720d..61b1984634a 100755 --- a/core/src/com/cloud/storage/template/FtpTemplateUploader.java +++ b/core/src/com/cloud/storage/template/FtpTemplateUploader.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.BufferedInputStream; diff --git a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java index fd5acc94fa0..235fb1cba3e 100644 --- a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java +++ b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; @@ -39,7 +43,6 @@ import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.params.HttpMethodParams; import org.apache.log4j.Logger; -import org.jnetpcap.util.resolver.Resolver.ResolverType; import com.cloud.agent.api.storage.DownloadCommand.Proxy; import com.cloud.agent.api.storage.DownloadCommand.ResourceType; diff --git a/core/src/com/cloud/storage/template/IsoProcessor.java b/core/src/com/cloud/storage/template/IsoProcessor.java index eca70586950..112002a641d 100644 --- a/core/src/com/cloud/storage/template/IsoProcessor.java +++ b/core/src/com/cloud/storage/template/IsoProcessor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java index b9a8013f0cb..c8927a117d3 100644 --- a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java +++ b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/Processor.java b/core/src/com/cloud/storage/template/Processor.java index 28be7bfbe92..2ec359318ff 100644 --- a/core/src/com/cloud/storage/template/Processor.java +++ b/core/src/com/cloud/storage/template/Processor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import com.cloud.exception.InternalErrorException; diff --git a/core/src/com/cloud/storage/template/QCOW2Processor.java b/core/src/com/cloud/storage/template/QCOW2Processor.java index 169c58c6c51..15af8490ea9 100644 --- a/core/src/com/cloud/storage/template/QCOW2Processor.java +++ b/core/src/com/cloud/storage/template/QCOW2Processor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/RawImageProcessor.java b/core/src/com/cloud/storage/template/RawImageProcessor.java index f0ed0280d5a..694c76a7074 100644 --- a/core/src/com/cloud/storage/template/RawImageProcessor.java +++ b/core/src/com/cloud/storage/template/RawImageProcessor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/ScpTemplateDownloader.java b/core/src/com/cloud/storage/template/ScpTemplateDownloader.java index 3aa32a53619..724392f812f 100644 --- a/core/src/com/cloud/storage/template/ScpTemplateDownloader.java +++ b/core/src/com/cloud/storage/template/ScpTemplateDownloader.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/TemplateConstants.java b/core/src/com/cloud/storage/template/TemplateConstants.java index 105fe8728a1..11aef8d0ee2 100644 --- a/core/src/com/cloud/storage/template/TemplateConstants.java +++ b/core/src/com/cloud/storage/template/TemplateConstants.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; /** diff --git a/core/src/com/cloud/storage/template/TemplateDownloader.java b/core/src/com/cloud/storage/template/TemplateDownloader.java index 4f91bba721b..07d155e66ec 100644 --- a/core/src/com/cloud/storage/template/TemplateDownloader.java +++ b/core/src/com/cloud/storage/template/TemplateDownloader.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; /** diff --git a/core/src/com/cloud/storage/template/TemplateDownloaderBase.java b/core/src/com/cloud/storage/template/TemplateDownloaderBase.java index 52f19df67ad..bdbdd457be1 100644 --- a/core/src/com/cloud/storage/template/TemplateDownloaderBase.java +++ b/core/src/com/cloud/storage/template/TemplateDownloaderBase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/TemplateLocation.java b/core/src/com/cloud/storage/template/TemplateLocation.java index 1071574bb2b..58d023a4907 100644 --- a/core/src/com/cloud/storage/template/TemplateLocation.java +++ b/core/src/com/cloud/storage/template/TemplateLocation.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/TemplateUploader.java b/core/src/com/cloud/storage/template/TemplateUploader.java index c637548ae8e..05de87c872a 100755 --- a/core/src/com/cloud/storage/template/TemplateUploader.java +++ b/core/src/com/cloud/storage/template/TemplateUploader.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import com.cloud.storage.template.TemplateUploader.UploadCompleteCallback; diff --git a/core/src/com/cloud/storage/template/UploadManager.java b/core/src/com/cloud/storage/template/UploadManager.java index 59d153b73f0..fa40b8c9ac6 100755 --- a/core/src/com/cloud/storage/template/UploadManager.java +++ b/core/src/com/cloud/storage/template/UploadManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import com.cloud.agent.api.storage.CreateEntityDownloadURLAnswer; diff --git a/core/src/com/cloud/storage/template/UploadManagerImpl.java b/core/src/com/cloud/storage/template/UploadManagerImpl.java index 717775f9c5a..2dd1751aeaa 100755 --- a/core/src/com/cloud/storage/template/UploadManagerImpl.java +++ b/core/src/com/cloud/storage/template/UploadManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/VhdProcessor.java b/core/src/com/cloud/storage/template/VhdProcessor.java index 65a4ee37865..b65b1dc876d 100644 --- a/core/src/com/cloud/storage/template/VhdProcessor.java +++ b/core/src/com/cloud/storage/template/VhdProcessor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/storage/template/VmdkProcessor.java b/core/src/com/cloud/storage/template/VmdkProcessor.java index d49dee96a04..ec7f014b4fd 100644 --- a/core/src/com/cloud/storage/template/VmdkProcessor.java +++ b/core/src/com/cloud/storage/template/VmdkProcessor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.storage.template; import java.io.File; diff --git a/core/src/com/cloud/user/AccountVO.java b/core/src/com/cloud/user/AccountVO.java index 629869d42bd..9848306c3f1 100644 --- a/core/src/com/cloud/user/AccountVO.java +++ b/core/src/com/cloud/user/AccountVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.user; import java.util.Date; diff --git a/core/src/com/cloud/user/SSHKeyPairVO.java b/core/src/com/cloud/user/SSHKeyPairVO.java index 4630393518b..0e13dc54c00 100644 --- a/core/src/com/cloud/user/SSHKeyPairVO.java +++ b/core/src/com/cloud/user/SSHKeyPairVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.user; import javax.persistence.Column; diff --git a/core/src/com/cloud/user/UserAccountVO.java b/core/src/com/cloud/user/UserAccountVO.java index 4211f62bf4c..f58e7882d48 100644 --- a/core/src/com/cloud/user/UserAccountVO.java +++ b/core/src/com/cloud/user/UserAccountVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.user; import java.util.Date; diff --git a/core/src/com/cloud/user/UserStatisticsVO.java b/core/src/com/cloud/user/UserStatisticsVO.java index d8c36b648a8..d560c3e6dad 100644 --- a/core/src/com/cloud/user/UserStatisticsVO.java +++ b/core/src/com/cloud/user/UserStatisticsVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.user; import javax.persistence.Column; diff --git a/core/src/com/cloud/user/UserStatsLogVO.java b/core/src/com/cloud/user/UserStatsLogVO.java index 7bf2076b63b..6f977953c4a 100644 --- a/core/src/com/cloud/user/UserStatsLogVO.java +++ b/core/src/com/cloud/user/UserStatsLogVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.user; import java.util.Date; diff --git a/core/src/com/cloud/user/UserVO.java b/core/src/com/cloud/user/UserVO.java index 96e4465fee8..99a89b5a859 100644 --- a/core/src/com/cloud/user/UserVO.java +++ b/core/src/com/cloud/user/UserVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.user; import java.util.Date; diff --git a/core/src/com/cloud/vm/ConsoleProxy.java b/core/src/com/cloud/vm/ConsoleProxy.java index 9f2847a2392..1d4fcb1629f 100644 --- a/core/src/com/cloud/vm/ConsoleProxy.java +++ b/core/src/com/cloud/vm/ConsoleProxy.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; /** diff --git a/core/src/com/cloud/vm/ConsoleProxyVO.java b/core/src/com/cloud/vm/ConsoleProxyVO.java index 63148b43825..c57b44f32f0 100644 --- a/core/src/com/cloud/vm/ConsoleProxyVO.java +++ b/core/src/com/cloud/vm/ConsoleProxyVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.Date; diff --git a/core/src/com/cloud/vm/DomainRouterVO.java b/core/src/com/cloud/vm/DomainRouterVO.java index 42c14c64e1a..39336f9d316 100755 --- a/core/src/com/cloud/vm/DomainRouterVO.java +++ b/core/src/com/cloud/vm/DomainRouterVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import javax.persistence.Column; diff --git a/core/src/com/cloud/vm/InstanceGroupVMMapVO.java b/core/src/com/cloud/vm/InstanceGroupVMMapVO.java index 8babaa2042f..09cfd9c6070 100644 --- a/core/src/com/cloud/vm/InstanceGroupVMMapVO.java +++ b/core/src/com/cloud/vm/InstanceGroupVMMapVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import javax.persistence.Column; diff --git a/core/src/com/cloud/vm/InstanceGroupVO.java b/core/src/com/cloud/vm/InstanceGroupVO.java index 56a236b4052..da1efa897da 100644 --- a/core/src/com/cloud/vm/InstanceGroupVO.java +++ b/core/src/com/cloud/vm/InstanceGroupVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.Date; diff --git a/core/src/com/cloud/vm/SecondaryStorageVm.java b/core/src/com/cloud/vm/SecondaryStorageVm.java index ba69f4ff8f8..9acff14c80b 100644 --- a/core/src/com/cloud/vm/SecondaryStorageVm.java +++ b/core/src/com/cloud/vm/SecondaryStorageVm.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; /** diff --git a/core/src/com/cloud/vm/SecondaryStorageVmVO.java b/core/src/com/cloud/vm/SecondaryStorageVmVO.java index 6c538ea0061..aa2efa55e44 100644 --- a/core/src/com/cloud/vm/SecondaryStorageVmVO.java +++ b/core/src/com/cloud/vm/SecondaryStorageVmVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.Date; diff --git a/core/src/com/cloud/vm/SystemVm.java b/core/src/com/cloud/vm/SystemVm.java index af27073ee1f..a697d081b7e 100644 --- a/core/src/com/cloud/vm/SystemVm.java +++ b/core/src/com/cloud/vm/SystemVm.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.Date; diff --git a/core/src/com/cloud/vm/UserVmDetailVO.java b/core/src/com/cloud/vm/UserVmDetailVO.java index 7e656658c5d..bf2f32351a1 100644 --- a/core/src/com/cloud/vm/UserVmDetailVO.java +++ b/core/src/com/cloud/vm/UserVmDetailVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import javax.persistence.Column; diff --git a/core/src/com/cloud/vm/UserVmVO.java b/core/src/com/cloud/vm/UserVmVO.java index bc5026b37dc..05a4bd1a636 100755 --- a/core/src/com/cloud/vm/UserVmVO.java +++ b/core/src/com/cloud/vm/UserVmVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.HashMap; diff --git a/core/src/com/cloud/vm/VMInstanceVO.java b/core/src/com/cloud/vm/VMInstanceVO.java index 8346719826d..07acae1bc84 100644 --- a/core/src/com/cloud/vm/VMInstanceVO.java +++ b/core/src/com/cloud/vm/VMInstanceVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.Date; diff --git a/core/src/com/cloud/vm/VirtualDisk.java b/core/src/com/cloud/vm/VirtualDisk.java index 9a9e37f37a7..ad7bb43d40b 100644 --- a/core/src/com/cloud/vm/VirtualDisk.java +++ b/core/src/com/cloud/vm/VirtualDisk.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import com.cloud.storage.Storage; diff --git a/core/src/com/cloud/vm/VirtualEnvironment.java b/core/src/com/cloud/vm/VirtualEnvironment.java index 1f3c677dda6..79d4a59bbfc 100644 --- a/core/src/com/cloud/vm/VirtualEnvironment.java +++ b/core/src/com/cloud/vm/VirtualEnvironment.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.List; diff --git a/core/src/com/cloud/vm/VirtualMachineName.java b/core/src/com/cloud/vm/VirtualMachineName.java index 20477708342..81838b9cd49 100755 --- a/core/src/com/cloud/vm/VirtualMachineName.java +++ b/core/src/com/cloud/vm/VirtualMachineName.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import java.util.Formatter; diff --git a/core/src/com/cloud/vm/VirtualNetwork.java b/core/src/com/cloud/vm/VirtualNetwork.java index fe4600fb620..ace3b80769f 100644 --- a/core/src/com/cloud/vm/VirtualNetwork.java +++ b/core/src/com/cloud/vm/VirtualNetwork.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; import com.cloud.network.Networks.IsolationType; diff --git a/core/src/com/cloud/vm/VmDetailConstants.java b/core/src/com/cloud/vm/VmDetailConstants.java index 46dda8cca55..90068d1b72b 100644 --- a/core/src/com/cloud/vm/VmDetailConstants.java +++ b/core/src/com/cloud/vm/VmDetailConstants.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vm; public interface VmDetailConstants { diff --git a/core/test/com/cloud/agent/transport/RequestTest.java b/core/test/com/cloud/agent/transport/RequestTest.java index 48e6a8f7a75..64c1e0bddef 100644 --- a/core/test/com/cloud/agent/transport/RequestTest.java +++ b/core/test/com/cloud/agent/transport/RequestTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.transport; import java.nio.ByteBuffer; diff --git a/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java b/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java index ee9fb515768..a857986de72 100644 --- a/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java +++ b/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor.vmware.mo; import com.cloud.hypervisor.vmware.util.VmwareContext; diff --git a/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareMO.java b/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareMO.java index 8cbc98a1d32..2f239da46a3 100644 --- a/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareMO.java +++ b/core/test/com/cloud/hypervisor/vmware/mo/TestVmwareMO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor.vmware.mo; import java.util.GregorianCalendar; diff --git a/core/test/com/cloud/hypervisor/vmware/util/TestVmwareUtil.java b/core/test/com/cloud/hypervisor/vmware/util/TestVmwareUtil.java index 30d4d261766..d1dd11b7c8e 100755 --- a/core/test/com/cloud/hypervisor/vmware/util/TestVmwareUtil.java +++ b/core/test/com/cloud/hypervisor/vmware/util/TestVmwareUtil.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.hypervisor.vmware.util; import java.io.File; diff --git a/core/test/com/cloud/vmware/TestVMWare.java b/core/test/com/cloud/vmware/TestVMWare.java index ae37fdf0e23..43c784ce2e6 100644 --- a/core/test/com/cloud/vmware/TestVMWare.java +++ b/core/test/com/cloud/vmware/TestVMWare.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.vmware; import java.io.BufferedInputStream; diff --git a/debian/cloud-console-proxy.config b/debian/cloud-console-proxy.config deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/debian/control b/debian/control index c5c2eb85460..517366d8797 100644 --- a/debian/control +++ b/debian/control @@ -142,7 +142,7 @@ Provides: vmops-agent Conflicts: vmops-agent Replaces: vmops-agent Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, jnetpcap, ebtables, vlan, libcglib-java, libcommons-httpclient-java, libservlet2.5-java, liblog4j1.2-java, libjna-java, wget +Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, libcglib-java, libcommons-httpclient-java, libservlet2.5-java, liblog4j1.2-java, libjna-java, wget Description: CloudStack agent The CloudStack agent is in charge of managing shared computing resources in a CloudStack Cloud Stack-powered cloud. Install this package if this computer diff --git a/deps/XenServerJava/com/xensource/xenapi/APIVersion.java b/deps/XenServerJava/com/xensource/xenapi/APIVersion.java index 497b2d9205e..c003fbc87f6 100644 --- a/deps/XenServerJava/com/xensource/xenapi/APIVersion.java +++ b/deps/XenServerJava/com/xensource/xenapi/APIVersion.java @@ -10,79 +10,74 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -package com.xensource.xenapi; - -public enum APIVersion -{ - API_1_1, API_1_2, API_1_3, API_1_4, API_1_5, API_1_6, API_1_7, UNKNOWN; - - public static APIVersion latest() - { - return API_1_7; - } - - public static APIVersion fromMajorMinor(long major, long minor) - { - if (major == 1 && minor == 7) - { - return API_1_7; - } - else if (major == 1 && minor == 6) - { - return API_1_6; - } - else if (major == 1 && minor == 5) - { - return API_1_5; - } - else if (major == 1 && minor == 4) - { - return API_1_4; - } - else if (major == 1 && minor == 3) - { - return API_1_3; - } - else if (major == 1 && minor == 2) - { - return API_1_2; - } - else if (major == 1 && minor == 1) - { - return API_1_1; - } - else - { - return UNKNOWN; - } - } - - @Override - public String toString() - { - switch (this) - { - case API_1_1: - return "1.1"; - case API_1_2: - return "1.2"; - case API_1_3: - return "1.3"; - case API_1_4: - return "1.4"; - case API_1_5: - return "1.5"; - case API_1_6: - return "1.6"; - case API_1_7: - return "1.7"; - default: - return "Unknown"; - } - } -} +package com.xensource.xenapi; + +public enum APIVersion +{ + API_1_1, API_1_2, API_1_3, API_1_4, API_1_5, API_1_6, API_1_7, UNKNOWN; + + public static APIVersion latest() + { + return API_1_7; + } + + public static APIVersion fromMajorMinor(long major, long minor) + { + if (major == 1 && minor == 7) + { + return API_1_7; + } + else if (major == 1 && minor == 6) + { + return API_1_6; + } + else if (major == 1 && minor == 5) + { + return API_1_5; + } + else if (major == 1 && minor == 4) + { + return API_1_4; + } + else if (major == 1 && minor == 3) + { + return API_1_3; + } + else if (major == 1 && minor == 2) + { + return API_1_2; + } + else if (major == 1 && minor == 1) + { + return API_1_1; + } + else + { + return UNKNOWN; + } + } + + @Override + public String toString() + { + switch (this) + { + case API_1_1: + return "1.1"; + case API_1_2: + return "1.2"; + case API_1_3: + return "1.3"; + case API_1_4: + return "1.4"; + case API_1_5: + return "1.5"; + case API_1_6: + return "1.6"; + case API_1_7: + return "1.7"; + default: + return "Unknown"; + } + } +} diff --git a/deps/XenServerJava/com/xensource/xenapi/Auth.java b/deps/XenServerJava/com/xensource/xenapi/Auth.java index 4c4074e85f9..142be36e31c 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Auth.java +++ b/deps/XenServerJava/com/xensource/xenapi/Auth.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Blob.java b/deps/XenServerJava/com/xensource/xenapi/Blob.java index afb7c1c7f45..9489d044f59 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Blob.java +++ b/deps/XenServerJava/com/xensource/xenapi/Blob.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Bond.java b/deps/XenServerJava/com/xensource/xenapi/Bond.java index 58ae9cca249..171d8b190fd 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Bond.java +++ b/deps/XenServerJava/com/xensource/xenapi/Bond.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Connection.java b/deps/XenServerJava/com/xensource/xenapi/Connection.java index 7a5f8fe2869..c856a7a7001 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Connection.java +++ b/deps/XenServerJava/com/xensource/xenapi/Connection.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.net.URL; diff --git a/deps/XenServerJava/com/xensource/xenapi/Console.java b/deps/XenServerJava/com/xensource/xenapi/Console.java index 79bd8aeb33d..04909e537aa 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Console.java +++ b/deps/XenServerJava/com/xensource/xenapi/Console.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Crashdump.java b/deps/XenServerJava/com/xensource/xenapi/Crashdump.java index 6d7b1dfda79..8dab0adf4c5 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Crashdump.java +++ b/deps/XenServerJava/com/xensource/xenapi/Crashdump.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/DataSource.java b/deps/XenServerJava/com/xensource/xenapi/DataSource.java index 015ab51314f..e623c10b725 100644 --- a/deps/XenServerJava/com/xensource/xenapi/DataSource.java +++ b/deps/XenServerJava/com/xensource/xenapi/DataSource.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Event.java b/deps/XenServerJava/com/xensource/xenapi/Event.java index 5ddf44571be..46e2d6c646f 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Event.java +++ b/deps/XenServerJava/com/xensource/xenapi/Event.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.io.PrintWriter; diff --git a/deps/XenServerJava/com/xensource/xenapi/Host.java b/deps/XenServerJava/com/xensource/xenapi/Host.java index 374e0801bc3..a80af94214b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Host.java +++ b/deps/XenServerJava/com/xensource/xenapi/Host.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostCpu.java b/deps/XenServerJava/com/xensource/xenapi/HostCpu.java index cff81b88a05..f73b583b1e7 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostCpu.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostCpu.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java b/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java index 771f9dd2714..a465e4d2c12 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java b/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java index 04b2192a151..d7e447f0698 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostPatch.java b/deps/XenServerJava/com/xensource/xenapi/HostPatch.java index c7a8eef7c51..889a5c58fd7 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostPatch.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostPatch.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Marshalling.java b/deps/XenServerJava/com/xensource/xenapi/Marshalling.java index f3b5ca73c9e..e2ee9d6ed9e 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Marshalling.java +++ b/deps/XenServerJava/com/xensource/xenapi/Marshalling.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.util.*; diff --git a/deps/XenServerJava/com/xensource/xenapi/Message.java b/deps/XenServerJava/com/xensource/xenapi/Message.java index 9f6146457a1..927ca5c7205 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Message.java +++ b/deps/XenServerJava/com/xensource/xenapi/Message.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Network.java b/deps/XenServerJava/com/xensource/xenapi/Network.java index 4400a51e27e..a013c89dd92 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Network.java +++ b/deps/XenServerJava/com/xensource/xenapi/Network.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PBD.java b/deps/XenServerJava/com/xensource/xenapi/PBD.java index 0c9dc788a3d..af9e732b70e 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PBD.java +++ b/deps/XenServerJava/com/xensource/xenapi/PBD.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PIF.java b/deps/XenServerJava/com/xensource/xenapi/PIF.java index 75276c7bb3e..e23e9428c02 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PIF.java +++ b/deps/XenServerJava/com/xensource/xenapi/PIF.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java b/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java index 2a2c3dc6be0..e3b9eca7f68 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Pool.java b/deps/XenServerJava/com/xensource/xenapi/Pool.java index ed5f41c9b87..1ace8bfe82b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Pool.java +++ b/deps/XenServerJava/com/xensource/xenapi/Pool.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java b/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java index 0d20fe47887..2d2649fbfb3 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java +++ b/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Role.java b/deps/XenServerJava/com/xensource/xenapi/Role.java index e550bde286f..e0ac9de5061 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Role.java +++ b/deps/XenServerJava/com/xensource/xenapi/Role.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/SM.java b/deps/XenServerJava/com/xensource/xenapi/SM.java index 66490ed8a39..c138ac551d3 100644 --- a/deps/XenServerJava/com/xensource/xenapi/SM.java +++ b/deps/XenServerJava/com/xensource/xenapi/SM.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/SR.java b/deps/XenServerJava/com/xensource/xenapi/SR.java index c57d33dc3db..114a66a555a 100644 --- a/deps/XenServerJava/com/xensource/xenapi/SR.java +++ b/deps/XenServerJava/com/xensource/xenapi/SR.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Secret.java b/deps/XenServerJava/com/xensource/xenapi/Secret.java index 114a723a5f0..9e692d61ccb 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Secret.java +++ b/deps/XenServerJava/com/xensource/xenapi/Secret.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Session.java b/deps/XenServerJava/com/xensource/xenapi/Session.java index bbbcd811853..042ed1a3b4b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Session.java +++ b/deps/XenServerJava/com/xensource/xenapi/Session.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Subject.java b/deps/XenServerJava/com/xensource/xenapi/Subject.java index d0d01c5ecce..cbba9a4fc10 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Subject.java +++ b/deps/XenServerJava/com/xensource/xenapi/Subject.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Task.java b/deps/XenServerJava/com/xensource/xenapi/Task.java index 9d8ee6b5c0f..ee688c7202b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Task.java +++ b/deps/XenServerJava/com/xensource/xenapi/Task.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Tunnel.java b/deps/XenServerJava/com/xensource/xenapi/Tunnel.java index ca4c8f45222..660eafbf73c 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Tunnel.java +++ b/deps/XenServerJava/com/xensource/xenapi/Tunnel.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Types.java b/deps/XenServerJava/com/xensource/xenapi/Types.java index 263a748ea8c..2e9f699b6b8 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Types.java +++ b/deps/XenServerJava/com/xensource/xenapi/Types.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.util.Date; diff --git a/deps/XenServerJava/com/xensource/xenapi/User.java b/deps/XenServerJava/com/xensource/xenapi/User.java index f439c8767d2..0c107b92514 100644 --- a/deps/XenServerJava/com/xensource/xenapi/User.java +++ b/deps/XenServerJava/com/xensource/xenapi/User.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VBD.java b/deps/XenServerJava/com/xensource/xenapi/VBD.java index 7914561e852..d644688d391 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VBD.java +++ b/deps/XenServerJava/com/xensource/xenapi/VBD.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java index a5b4e22481e..245e48806ee 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VDI.java b/deps/XenServerJava/com/xensource/xenapi/VDI.java index aea5b2e4605..99ab210defe 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VDI.java +++ b/deps/XenServerJava/com/xensource/xenapi/VDI.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VIF.java b/deps/XenServerJava/com/xensource/xenapi/VIF.java index ac025a19d31..25323de0205 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VIF.java +++ b/deps/XenServerJava/com/xensource/xenapi/VIF.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java index 10e5588d240..565747f7fe1 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VLAN.java b/deps/XenServerJava/com/xensource/xenapi/VLAN.java index bbda8763cc1..5429077bd61 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VLAN.java +++ b/deps/XenServerJava/com/xensource/xenapi/VLAN.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VM.java b/deps/XenServerJava/com/xensource/xenapi/VM.java index 008431a96aa..1b26d974524 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VM.java +++ b/deps/XenServerJava/com/xensource/xenapi/VM.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java index c8498710df8..12dd26a87ea 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java index 9e2c836b18c..47634e9a10e 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VMPP.java b/deps/XenServerJava/com/xensource/xenapi/VMPP.java index 8732c8b80e7..5df76ad51ff 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VMPP.java +++ b/deps/XenServerJava/com/xensource/xenapi/VMPP.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VTPM.java b/deps/XenServerJava/com/xensource/xenapi/VTPM.java index a993fe5f292..a443d5194ff 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VTPM.java +++ b/deps/XenServerJava/com/xensource/xenapi/VTPM.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java b/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java index f323f61ed6c..700e3299604 100644 --- a/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java +++ b/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; public abstract class XenAPIObject diff --git a/docs/2.0/CloudStack2.0AdapterFrameworkGuide.docx b/docs/2.0/CloudStack2.0AdapterFrameworkGuide.docx deleted file mode 100755 index 2227647fb0c..00000000000 Binary files a/docs/2.0/CloudStack2.0AdapterFrameworkGuide.docx and /dev/null differ diff --git a/docs/2.0/downloads.html b/docs/2.0/downloads.html deleted file mode 100644 index b502ffb56af..00000000000 --- a/docs/2.0/downloads.html +++ /dev/null @@ -1,856 +0,0 @@ - - - - -CloudStack Commercial Releases - - - - - -
- - - - -
- -
-
-
-
16
-
May
- -
2011
- -
-

CloudStack 2.2.4

-
- -
-
- - -
-
-
-
17
-
Mar
- -
2011
- -
-

CloudStack 2.2.3

-
- -
-
- - - -
-
-
-
16
-
Feb
- -
2011
- -
-

CloudStack 2.2.1

-
- -
-
- - - - - - -
-
-
-
22
-
Mar
- -
2011
- -
-

CloudStack 2.1.9

-
-
-
- - - -
- - -
-
-
- -
-
-
-
22
-
Mar
- -
2011
- -
-

CloudStack 2.1.8

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
10
-
Jan
- -
2011
- -
-

CloudStack 2.1.7

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
23
-
Nov
- -
2010
- -
-

CloudStack 2.1.6

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
16
-
Nov
- -
2010
- -
-

CloudStack 2.1.5

-
-
-
- - - -
- - -
-
-
- - - - -
-
-
-
15
-
Oct
- -
2010
- -
-

CloudStack 2.1.4

-
-
-
- - - -
- - -
-
-
- - - -
-
-
-
7
-
Sep
- -
2010
- -
-

CloudStack 2.1.3

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
6
-
Aug
- -
2010
- -
-

CloudStack 2.1.2

-
-
-
- - - -
- - -
-
-
- - - -
-
-
-
26
-
Jul
- -
2010
- -
-

CloudStack 2.1.1

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
23
-
Jul
- -
2010
- -
-

CloudStack 2.1.0

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
7
-
Jul
- -
2010
- -
-

CloudStack 2.0.1

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
17
-
Jun
- -
2010
- -
-

CloudStack 2.0.0

-
-
-
- - - -
- - -
-
-
- - - -
-
- - diff --git a/docs/2.1/CloudStack 2.1 Adapter Framework Guide.pdf b/docs/2.1/CloudStack 2.1 Adapter Framework Guide.pdf deleted file mode 100644 index f93f791fccd..00000000000 Binary files a/docs/2.1/CloudStack 2.1 Adapter Framework Guide.pdf and /dev/null differ diff --git a/docs/2.1/CloudStack 2.1.3 User Interface Customization.pdf b/docs/2.1/CloudStack 2.1.3 User Interface Customization.pdf deleted file mode 100644 index 64d87f763d9..00000000000 Binary files a/docs/2.1/CloudStack 2.1.3 User Interface Customization.pdf and /dev/null differ diff --git a/docs/2.1/CloudStack2.1.1ReleaseNotes.docx b/docs/2.1/CloudStack2.1.1ReleaseNotes.docx deleted file mode 100755 index 29c38982d7a..00000000000 Binary files a/docs/2.1/CloudStack2.1.1ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1.2ReleaseNotes.docx b/docs/2.1/CloudStack2.1.2ReleaseNotes.docx deleted file mode 100755 index 42aa1e9782f..00000000000 Binary files a/docs/2.1/CloudStack2.1.2ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1.3FOSSReleaseNotes.docx b/docs/2.1/CloudStack2.1.3FOSSReleaseNotes.docx deleted file mode 100755 index 53fe2acdb11..00000000000 Binary files a/docs/2.1/CloudStack2.1.3FOSSReleaseNotes.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1.3ReleaseNotes.docx b/docs/2.1/CloudStack2.1.3ReleaseNotes.docx deleted file mode 100755 index 493faf754a6..00000000000 Binary files a/docs/2.1/CloudStack2.1.3ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1AdminGuide.docx b/docs/2.1/CloudStack2.1AdminGuide.docx deleted file mode 100755 index f60e20eff16..00000000000 Binary files a/docs/2.1/CloudStack2.1AdminGuide.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1FOSSInstallationGuide.docx b/docs/2.1/CloudStack2.1FOSSInstallationGuide.docx deleted file mode 100755 index ca679c41537..00000000000 Binary files a/docs/2.1/CloudStack2.1FOSSInstallationGuide.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1InstallGuide.docx b/docs/2.1/CloudStack2.1InstallGuide.docx deleted file mode 100755 index 12a316e4e3b..00000000000 Binary files a/docs/2.1/CloudStack2.1InstallGuide.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1ReleaseNotes.docx b/docs/2.1/CloudStack2.1ReleaseNotes.docx deleted file mode 100755 index a02ab39f096..00000000000 Binary files a/docs/2.1/CloudStack2.1ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.1/CloudStack2.1UserInterfaceCustomization.docx b/docs/2.1/CloudStack2.1UserInterfaceCustomization.docx deleted file mode 100755 index 631531f22f4..00000000000 Binary files a/docs/2.1/CloudStack2.1UserInterfaceCustomization.docx and /dev/null differ diff --git a/docs/2.2/CloudBridgeGuide.docx b/docs/2.2/CloudBridgeGuide.docx deleted file mode 100644 index 4510e0f6bc8..00000000000 Binary files a/docs/2.2/CloudBridgeGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.11AdminGuide.docx b/docs/2.2/CloudStack2.2.11AdminGuide.docx deleted file mode 100644 index 8901dd3d921..00000000000 Binary files a/docs/2.2/CloudStack2.2.11AdminGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.11AdminGuide.pdf b/docs/2.2/CloudStack2.2.11AdminGuide.pdf deleted file mode 100644 index 78225f396a3..00000000000 Binary files a/docs/2.2/CloudStack2.2.11AdminGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.11InstallGuide.docx b/docs/2.2/CloudStack2.2.11InstallGuide.docx deleted file mode 100644 index c97967863f3..00000000000 Binary files a/docs/2.2/CloudStack2.2.11InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.11InstallGuide.pdf b/docs/2.2/CloudStack2.2.11InstallGuide.pdf deleted file mode 100644 index c8cde587d5b..00000000000 Binary files a/docs/2.2/CloudStack2.2.11InstallGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.11ReleaseNotes.docx b/docs/2.2/CloudStack2.2.11ReleaseNotes.docx deleted file mode 100644 index 03af3561c86..00000000000 Binary files a/docs/2.2/CloudStack2.2.11ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.11ReleaseNotes.pdf b/docs/2.2/CloudStack2.2.11ReleaseNotes.pdf deleted file mode 100644 index e3f439878fd..00000000000 Binary files a/docs/2.2/CloudStack2.2.11ReleaseNotes.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.12AdminGuide.docx b/docs/2.2/CloudStack2.2.12AdminGuide.docx deleted file mode 100644 index b33ceefd417..00000000000 Binary files a/docs/2.2/CloudStack2.2.12AdminGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.12AdminGuide.pdf b/docs/2.2/CloudStack2.2.12AdminGuide.pdf deleted file mode 100644 index f4e2f828076..00000000000 Binary files a/docs/2.2/CloudStack2.2.12AdminGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.12InstallGuide.docx b/docs/2.2/CloudStack2.2.12InstallGuide.docx deleted file mode 100644 index 4e9911abb14..00000000000 Binary files a/docs/2.2/CloudStack2.2.12InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.12InstallGuide.pdf b/docs/2.2/CloudStack2.2.12InstallGuide.pdf deleted file mode 100644 index 54be23fca21..00000000000 Binary files a/docs/2.2/CloudStack2.2.12InstallGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.12ReleaseNotes.docx b/docs/2.2/CloudStack2.2.12ReleaseNotes.docx deleted file mode 100644 index a4530e3a8b0..00000000000 Binary files a/docs/2.2/CloudStack2.2.12ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.12ReleaseNotes.pdf b/docs/2.2/CloudStack2.2.12ReleaseNotes.pdf deleted file mode 100644 index bc01d9ad93c..00000000000 Binary files a/docs/2.2/CloudStack2.2.12ReleaseNotes.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.13AdminGuide.docx b/docs/2.2/CloudStack2.2.13AdminGuide.docx deleted file mode 100644 index 2d93a91362c..00000000000 Binary files a/docs/2.2/CloudStack2.2.13AdminGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.13InstallGuide.docx b/docs/2.2/CloudStack2.2.13InstallGuide.docx deleted file mode 100644 index 1f9a43164ee..00000000000 Binary files a/docs/2.2/CloudStack2.2.13InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.13ReleaseNotes.docx b/docs/2.2/CloudStack2.2.13ReleaseNotes.docx deleted file mode 100644 index 38a0f7a01d1..00000000000 Binary files a/docs/2.2/CloudStack2.2.13ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.14InstallGuide.docx b/docs/2.2/CloudStack2.2.14InstallGuide.docx deleted file mode 100644 index f3ecf706ce3..00000000000 Binary files a/docs/2.2/CloudStack2.2.14InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.14ReleaseNotes.docx b/docs/2.2/CloudStack2.2.14ReleaseNotes.docx deleted file mode 100644 index 5b466d41b2e..00000000000 Binary files a/docs/2.2/CloudStack2.2.14ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.1ReleaseNotes.docx b/docs/2.2/CloudStack2.2.1ReleaseNotes.docx deleted file mode 100644 index 636a3915297..00000000000 Binary files a/docs/2.2/CloudStack2.2.1ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.2ReleaseNotes.docx b/docs/2.2/CloudStack2.2.2ReleaseNotes.docx deleted file mode 100644 index ecfef3c7ee8..00000000000 Binary files a/docs/2.2/CloudStack2.2.2ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.3ReleaseNotes.docx b/docs/2.2/CloudStack2.2.3ReleaseNotes.docx deleted file mode 100644 index 3e3bdf6ab05..00000000000 Binary files a/docs/2.2/CloudStack2.2.3ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.4AdminGuide.docx b/docs/2.2/CloudStack2.2.4AdminGuide.docx deleted file mode 100644 index 7ee14ba6b70..00000000000 Binary files a/docs/2.2/CloudStack2.2.4AdminGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.4AdminGuide.pdf b/docs/2.2/CloudStack2.2.4AdminGuide.pdf deleted file mode 100644 index 902d9080f14..00000000000 Binary files a/docs/2.2/CloudStack2.2.4AdminGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.4InstallGuide.docx b/docs/2.2/CloudStack2.2.4InstallGuide.docx deleted file mode 100644 index 8cddb63716c..00000000000 Binary files a/docs/2.2/CloudStack2.2.4InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.4InstallGuide.pdf b/docs/2.2/CloudStack2.2.4InstallGuide.pdf deleted file mode 100644 index a571e34e5e2..00000000000 Binary files a/docs/2.2/CloudStack2.2.4InstallGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.4ReleaseNotes.docx b/docs/2.2/CloudStack2.2.4ReleaseNotes.docx deleted file mode 100644 index 93943e5aabc..00000000000 Binary files a/docs/2.2/CloudStack2.2.4ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.5ReleaseNotes.docx b/docs/2.2/CloudStack2.2.5ReleaseNotes.docx deleted file mode 100644 index b1f672ef7ff..00000000000 Binary files a/docs/2.2/CloudStack2.2.5ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.8AdminGuide.docx b/docs/2.2/CloudStack2.2.8AdminGuide.docx deleted file mode 100644 index 600a6895a8e..00000000000 Binary files a/docs/2.2/CloudStack2.2.8AdminGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.8AdminGuide.pdf b/docs/2.2/CloudStack2.2.8AdminGuide.pdf deleted file mode 100644 index 52652378cbd..00000000000 Binary files a/docs/2.2/CloudStack2.2.8AdminGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.8InstallGuide.docx b/docs/2.2/CloudStack2.2.8InstallGuide.docx deleted file mode 100644 index e07450ef629..00000000000 Binary files a/docs/2.2/CloudStack2.2.8InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.8InstallGuide.pdf b/docs/2.2/CloudStack2.2.8InstallGuide.pdf deleted file mode 100644 index b3735b3010c..00000000000 Binary files a/docs/2.2/CloudStack2.2.8InstallGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.9AdminGuide.pdf b/docs/2.2/CloudStack2.2.9AdminGuide.pdf deleted file mode 100644 index e62d075aeb7..00000000000 Binary files a/docs/2.2/CloudStack2.2.9AdminGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.9InstallGuide.pdf b/docs/2.2/CloudStack2.2.9InstallGuide.pdf deleted file mode 100644 index 47ff41311f0..00000000000 Binary files a/docs/2.2/CloudStack2.2.9InstallGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.9ReleaseNotes.docx b/docs/2.2/CloudStack2.2.9ReleaseNotes.docx deleted file mode 100644 index 47971d87163..00000000000 Binary files a/docs/2.2/CloudStack2.2.9ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2.9ReleaseNotes.pdf b/docs/2.2/CloudStack2.2.9ReleaseNotes.pdf deleted file mode 100644 index 3a6e6d0442a..00000000000 Binary files a/docs/2.2/CloudStack2.2.9ReleaseNotes.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2AdminGuide.docx b/docs/2.2/CloudStack2.2AdminGuide.docx deleted file mode 100644 index 14e7017a916..00000000000 Binary files a/docs/2.2/CloudStack2.2AdminGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2AdminGuide.pdf b/docs/2.2/CloudStack2.2AdminGuide.pdf deleted file mode 100644 index 58f0357d6b7..00000000000 Binary files a/docs/2.2/CloudStack2.2AdminGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2AllocatorImplementationGuide.docx b/docs/2.2/CloudStack2.2AllocatorImplementationGuide.docx deleted file mode 100644 index 8108d99cc3e..00000000000 Binary files a/docs/2.2/CloudStack2.2AllocatorImplementationGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2DeveloperGuide.docx b/docs/2.2/CloudStack2.2DeveloperGuide.docx deleted file mode 100644 index 8cf81eb6217..00000000000 Binary files a/docs/2.2/CloudStack2.2DeveloperGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2InstallGuide.docx b/docs/2.2/CloudStack2.2InstallGuide.docx deleted file mode 100644 index 2d62dc6fba4..00000000000 Binary files a/docs/2.2/CloudStack2.2InstallGuide.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2InstallGuide.pdf b/docs/2.2/CloudStack2.2InstallGuide.pdf deleted file mode 100644 index ca5f8fa643b..00000000000 Binary files a/docs/2.2/CloudStack2.2InstallGuide.pdf and /dev/null differ diff --git a/docs/2.2/CloudStack2.2ReleaseNotes.docx b/docs/2.2/CloudStack2.2ReleaseNotes.docx deleted file mode 100644 index d790f95e8c0..00000000000 Binary files a/docs/2.2/CloudStack2.2ReleaseNotes.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2UserInterfaceCustomization.docx b/docs/2.2/CloudStack2.2UserInterfaceCustomization.docx deleted file mode 100644 index c20027d2ca5..00000000000 Binary files a/docs/2.2/CloudStack2.2UserInterfaceCustomization.docx and /dev/null differ diff --git a/docs/2.2/CloudStack2.2UserInterfaceCustomization.pdf b/docs/2.2/CloudStack2.2UserInterfaceCustomization.pdf deleted file mode 100644 index d8026458d0f..00000000000 Binary files a/docs/2.2/CloudStack2.2UserInterfaceCustomization.pdf and /dev/null differ diff --git a/docs/2.2/downloads-supp3.html b/docs/2.2/downloads-supp3.html deleted file mode 100644 index 199af2314d4..00000000000 --- a/docs/2.2/downloads-supp3.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - -CloudStack Commercial Releases - - - - - -
- - - - - diff --git a/docs/2.2/downloads.html b/docs/2.2/downloads.html deleted file mode 100644 index ea2c8240edc..00000000000 --- a/docs/2.2/downloads.html +++ /dev/null @@ -1,1305 +0,0 @@ - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
3
-
June
- -
2011
- -
-

CloudStack 2.1.10

-
-
-
- - - -
- - -
-
-
- - - - - -
-
-
-
22
-
Mar
- -
2011
- -
-

CloudStack 2.1.9

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
22
-
Mar
- -
2011
- -
-

CloudStack 2.1.8

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
10
-
Jan
- -
2011
- -
-

CloudStack 2.1.7

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
23
-
Nov
- -
2010
- -
-

CloudStack 2.1.6

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
16
-
Nov
- -
2010
- -
-

CloudStack 2.1.5

-
-
-
- - - -
- - -
-
-
- - - - -
-
-
-
15
-
Oct
- -
2010
- -
-

CloudStack 2.1.4

-
-
-
- - - -
- - -
-
-
- - - -
-
-
-
7
-
Sep
- -
2010
- -
-

CloudStack 2.1.3

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
6
-
Aug
- -
2010
- -
-

CloudStack 2.1.2

-
-
-
- - - -
- - -
-
-
- - - -
-
-
-
26
-
Jul
- -
2010
- -
-

CloudStack 2.1.1

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
23
-
Jul
- -
2010
- -
-

CloudStack 2.1.0

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
7
-
Jul
- -
2010
- -
-

CloudStack 2.0.1

-
-
-
- - - -
- - -
-
-
- - -
-
-
-
17
-
Jun
- -
2010
- -
-

CloudStack 2.0.0

-
-
-
- - - -
- - -
-
-
- - - -
-
- - - - - - -CloudStack Commercial Releases - - - - diff --git a/docs/3.0/CloudPortal1.3FeaturesList.docx b/docs/3.0/CloudPortal1.3FeaturesList.docx deleted file mode 100644 index efc85822757..00000000000 Binary files a/docs/3.0/CloudPortal1.3FeaturesList.docx and /dev/null differ diff --git a/docs/3.0/CloudStack2.2_3.0DeveloperGuide.docx b/docs/3.0/CloudStack2.2_3.0DeveloperGuide.docx deleted file mode 100644 index 8087271510f..00000000000 Binary files a/docs/3.0/CloudStack2.2_3.0DeveloperGuide.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0.0ReleaseNotes.docx b/docs/3.0/CloudStack3.0.0ReleaseNotes.docx deleted file mode 100644 index 295c378b952..00000000000 Binary files a/docs/3.0/CloudStack3.0.0ReleaseNotes.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0.1ReleaseNotes.docx b/docs/3.0/CloudStack3.0.1ReleaseNotes.docx deleted file mode 100644 index 26f15ef0e0e..00000000000 Binary files a/docs/3.0/CloudStack3.0.1ReleaseNotes.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0.2ReleaseNotes.docx b/docs/3.0/CloudStack3.0.2ReleaseNotes.docx deleted file mode 100644 index ad933913e33..00000000000 Binary files a/docs/3.0/CloudStack3.0.2ReleaseNotes.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0AdminGuide.docx b/docs/3.0/CloudStack3.0AdminGuide.docx deleted file mode 100644 index bf9b77c30d1..00000000000 Binary files a/docs/3.0/CloudStack3.0AdminGuide.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0AdminGuide.pdf b/docs/3.0/CloudStack3.0AdminGuide.pdf deleted file mode 100644 index 8caf986ff69..00000000000 Binary files a/docs/3.0/CloudStack3.0AdminGuide.pdf and /dev/null differ diff --git a/docs/3.0/CloudStack3.0AdminGuide_BareMetal.docx b/docs/3.0/CloudStack3.0AdminGuide_BareMetal.docx deleted file mode 100644 index aa55a17d98b..00000000000 Binary files a/docs/3.0/CloudStack3.0AdminGuide_BareMetal.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0FeaturesList.docx b/docs/3.0/CloudStack3.0FeaturesList.docx deleted file mode 100644 index a0e02ec9b0e..00000000000 Binary files a/docs/3.0/CloudStack3.0FeaturesList.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0InstallGuide.docx b/docs/3.0/CloudStack3.0InstallGuide.docx deleted file mode 100644 index 546d413512a..00000000000 Binary files a/docs/3.0/CloudStack3.0InstallGuide.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0InstallGuide_BareMetal.docx b/docs/3.0/CloudStack3.0InstallGuide_BareMetal.docx deleted file mode 100644 index 304fdce44ad..00000000000 Binary files a/docs/3.0/CloudStack3.0InstallGuide_BareMetal.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0NewFeatures.docx b/docs/3.0/CloudStack3.0NewFeatures.docx deleted file mode 100644 index 0cafbb7b1c2..00000000000 Binary files a/docs/3.0/CloudStack3.0NewFeatures.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0Overview.docx b/docs/3.0/CloudStack3.0Overview.docx deleted file mode 100644 index 414c6317023..00000000000 Binary files a/docs/3.0/CloudStack3.0Overview.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0QuickInstallGuide.docx b/docs/3.0/CloudStack3.0QuickInstallGuide.docx deleted file mode 100644 index 30768dcda43..00000000000 Binary files a/docs/3.0/CloudStack3.0QuickInstallGuide.docx and /dev/null differ diff --git a/docs/3.0/CloudStack3.0UserInterfaceCustomization.docx b/docs/3.0/CloudStack3.0UserInterfaceCustomization.docx deleted file mode 100644 index f18864da429..00000000000 Binary files a/docs/3.0/CloudStack3.0UserInterfaceCustomization.docx and /dev/null differ diff --git a/docs/3.0/CloudStackAndCloudPortalFeaturesList.docx b/docs/3.0/CloudStackAndCloudPortalFeaturesList.docx deleted file mode 100644 index 1a6657ab32a..00000000000 Binary files a/docs/3.0/CloudStackAndCloudPortalFeaturesList.docx and /dev/null differ diff --git a/docs/CloudStack2.0AdapterFrameworkGuide.docx b/docs/CloudStack2.0AdapterFrameworkGuide.docx deleted file mode 100755 index 2227647fb0c..00000000000 Binary files a/docs/CloudStack2.0AdapterFrameworkGuide.docx and /dev/null differ diff --git a/docs/CloudStack2.1.1ReleaseNotes.docx b/docs/CloudStack2.1.1ReleaseNotes.docx deleted file mode 100755 index 29c38982d7a..00000000000 Binary files a/docs/CloudStack2.1.1ReleaseNotes.docx and /dev/null differ diff --git a/docs/CloudStack2.1.2ReleaseNotes.docx b/docs/CloudStack2.1.2ReleaseNotes.docx deleted file mode 100755 index 42aa1e9782f..00000000000 Binary files a/docs/CloudStack2.1.2ReleaseNotes.docx and /dev/null differ diff --git a/docs/CloudStack2.1.3FOSSReleaseNotes.docx b/docs/CloudStack2.1.3FOSSReleaseNotes.docx deleted file mode 100755 index 53fe2acdb11..00000000000 Binary files a/docs/CloudStack2.1.3FOSSReleaseNotes.docx and /dev/null differ diff --git a/docs/CloudStack2.1.3ReleaseNotes.docx b/docs/CloudStack2.1.3ReleaseNotes.docx deleted file mode 100755 index 493faf754a6..00000000000 Binary files a/docs/CloudStack2.1.3ReleaseNotes.docx and /dev/null differ diff --git a/docs/CloudStack2.1AdminGuide.docx b/docs/CloudStack2.1AdminGuide.docx deleted file mode 100755 index f60e20eff16..00000000000 Binary files a/docs/CloudStack2.1AdminGuide.docx and /dev/null differ diff --git a/docs/CloudStack2.1FOSSInstallationGuide.docx b/docs/CloudStack2.1FOSSInstallationGuide.docx deleted file mode 100755 index ca679c41537..00000000000 Binary files a/docs/CloudStack2.1FOSSInstallationGuide.docx and /dev/null differ diff --git a/docs/CloudStack2.1InstallGuide.docx b/docs/CloudStack2.1InstallGuide.docx deleted file mode 100755 index 12a316e4e3b..00000000000 Binary files a/docs/CloudStack2.1InstallGuide.docx and /dev/null differ diff --git a/docs/CloudStack2.1ReleaseNotes.docx b/docs/CloudStack2.1ReleaseNotes.docx deleted file mode 100755 index a02ab39f096..00000000000 Binary files a/docs/CloudStack2.1ReleaseNotes.docx and /dev/null differ diff --git a/docs/CloudStack2.1UserInterfaceCustomization.docx b/docs/CloudStack2.1UserInterfaceCustomization.docx deleted file mode 100755 index 631531f22f4..00000000000 Binary files a/docs/CloudStack2.1UserInterfaceCustomization.docx and /dev/null differ diff --git a/docs/publican-cloudstack/LICENSE b/docs/publican-cloudstack/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/docs/publican-cloudstack/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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/docs/publican-cloudstack/NOTICE b/docs/publican-cloudstack/NOTICE new file mode 100644 index 00000000000..c7720bf1819 --- /dev/null +++ b/docs/publican-cloudstack/NOTICE @@ -0,0 +1,5 @@ +Apache CloudStack +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/docs/publican-cloudstack/README b/docs/publican-cloudstack/README new file mode 100644 index 00000000000..5b1c753beba --- /dev/null +++ b/docs/publican-cloudstack/README @@ -0,0 +1,8 @@ +This is the documentation brand for CloudStack Project +This brand is needed for building CloudStack documentation. + +To learn more about CloudStack visit: +http://cloudstack.org + +To learn more about Publican visit: +https://fedorahosted.org/publican/ diff --git a/docs/publican-cloudstack/en-US/Feedback.xml b/docs/publican-cloudstack/en-US/Feedback.xml new file mode 100644 index 00000000000..5236b0f8309 --- /dev/null +++ b/docs/publican-cloudstack/en-US/Feedback.xml @@ -0,0 +1,27 @@ + + +
+ We Need Feedback! + + feedback1 + contact information for this brand + + + + If you find a typographical error in this manual, or if you + have thought of a way to make this manual better, we would + love to hear from you! Please submit a bug: + http://bugs.cloudstack.org + against the component Doc + + + If you have a suggestion for improving the documentation, try to be as + specific as possible when describing it. If you have found an error, + please include the section number and some of the surrounding text + so we can find it easily. + + +
+ + diff --git a/docs/publican-cloudstack/en-US/Legal_Notice.xml b/docs/publican-cloudstack/en-US/Legal_Notice.xml new file mode 100644 index 00000000000..1dd72812908 --- /dev/null +++ b/docs/publican-cloudstack/en-US/Legal_Notice.xml @@ -0,0 +1,39 @@ + + + + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + + http://www.apache.org/licenses/LICENSE-2.0 + + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + + + Apache CloudStack is an effort undergoing incubation at The Apache Software Foundation (ASF). + + + Incubation is required of all newly accepted projects until a further review + indicates that the infrastructure, communications, and decision making + process have stabilized in a manner consistent with other successful ASF + projects. While incubation status is not necessarily a reflection of the + completeness or stability of the code, it does indicate that the project + has yet to be fully endorsed by the ASF. + + + + diff --git a/docs/publican-cloudstack/en-US/css/overrides.css b/docs/publican-cloudstack/en-US/css/overrides.css new file mode 100644 index 00000000000..ebd9730b690 --- /dev/null +++ b/docs/publican-cloudstack/en-US/css/overrides.css @@ -0,0 +1,57 @@ +a:link { + color:#0066cc; +} + +a:visited { + color:#6699cc; +} + +h1 { + color:#3c6eb4; +} + +.producttitle { + background: #3c6eb4 url(../images/h1-bg.png) top left repeat; +} + +.section h1.title { + color:#3c6eb4; +} + + +h2,h3,h4,h5,h6 { + color:#3c6eb4 +} + +table { + border:1px solid #3c6eb4; +} + +table th { + background-color:#3c6eb4; +} + +table tr.even td { + background-color:#f5f5f5; +} + +#title a { + height:54px; +} + +.term{ + color:#a70000; +} + +.revhistory table th { + color:#3c6eb4; +} + +.edition { + color: #3c6eb4; +} + +span.remark{ + background-color: #ffff00; +} + diff --git a/docs/publican-cloudstack/en-US/images/.directory b/docs/publican-cloudstack/en-US/images/.directory new file mode 100644 index 00000000000..44ce2756e62 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/.directory @@ -0,0 +1,4 @@ +[Dolphin] +ShowPreview=true +Timestamp=2011,8,11,15,3,32 +Version=2 diff --git a/docs/publican-cloudstack/en-US/images/1.png b/docs/publican-cloudstack/en-US/images/1.png new file mode 100644 index 00000000000..098e7dfd698 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/1.png differ diff --git a/docs/publican-cloudstack/en-US/images/1.svg b/docs/publican-cloudstack/en-US/images/1.svg new file mode 100644 index 00000000000..a874e974c1c --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/1.svg @@ -0,0 +1,28 @@ + + + + + + 1 + diff --git a/docs/publican-cloudstack/en-US/images/10.png b/docs/publican-cloudstack/en-US/images/10.png new file mode 100644 index 00000000000..1d2ab13127b Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/10.png differ diff --git a/docs/publican-cloudstack/en-US/images/10.svg b/docs/publican-cloudstack/en-US/images/10.svg new file mode 100644 index 00000000000..6892e0de9b5 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/10.svg @@ -0,0 +1,28 @@ + + + + + + 10 + diff --git a/docs/publican-cloudstack/en-US/images/11.png b/docs/publican-cloudstack/en-US/images/11.png new file mode 100644 index 00000000000..897afb30257 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/11.png differ diff --git a/docs/publican-cloudstack/en-US/images/11.svg b/docs/publican-cloudstack/en-US/images/11.svg new file mode 100644 index 00000000000..7f5c269cfc5 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/11.svg @@ -0,0 +1,28 @@ + + + + + + 11 + diff --git a/docs/publican-cloudstack/en-US/images/12.png b/docs/publican-cloudstack/en-US/images/12.png new file mode 100644 index 00000000000..b2aa1bddc4f Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/12.png differ diff --git a/docs/publican-cloudstack/en-US/images/12.svg b/docs/publican-cloudstack/en-US/images/12.svg new file mode 100644 index 00000000000..9bcf3cc586c --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/12.svg @@ -0,0 +1,28 @@ + + + + + + 12 + diff --git a/docs/publican-cloudstack/en-US/images/13.png b/docs/publican-cloudstack/en-US/images/13.png new file mode 100644 index 00000000000..c6e0022be06 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/13.png differ diff --git a/docs/publican-cloudstack/en-US/images/13.svg b/docs/publican-cloudstack/en-US/images/13.svg new file mode 100644 index 00000000000..796664551fa --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/13.svg @@ -0,0 +1,28 @@ + + + + + + 13 + diff --git a/docs/publican-cloudstack/en-US/images/14.png b/docs/publican-cloudstack/en-US/images/14.png new file mode 100644 index 00000000000..93833719cff Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/14.png differ diff --git a/docs/publican-cloudstack/en-US/images/14.svg b/docs/publican-cloudstack/en-US/images/14.svg new file mode 100644 index 00000000000..869be6ab2bb --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/14.svg @@ -0,0 +1,28 @@ + + + + + + 14 + diff --git a/docs/publican-cloudstack/en-US/images/15.png b/docs/publican-cloudstack/en-US/images/15.png new file mode 100644 index 00000000000..e50bcb95031 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/15.png differ diff --git a/docs/publican-cloudstack/en-US/images/15.svg b/docs/publican-cloudstack/en-US/images/15.svg new file mode 100644 index 00000000000..003f16c2e85 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/15.svg @@ -0,0 +1,28 @@ + + + + + + 15 + diff --git a/docs/publican-cloudstack/en-US/images/16.png b/docs/publican-cloudstack/en-US/images/16.png new file mode 100644 index 00000000000..ff3705d120a Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/16.png differ diff --git a/docs/publican-cloudstack/en-US/images/16.svg b/docs/publican-cloudstack/en-US/images/16.svg new file mode 100644 index 00000000000..ab4bee018bf --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/16.svg @@ -0,0 +1,28 @@ + + + + + + 16 + diff --git a/docs/publican-cloudstack/en-US/images/17.png b/docs/publican-cloudstack/en-US/images/17.png new file mode 100644 index 00000000000..594964530b0 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/17.png differ diff --git a/docs/publican-cloudstack/en-US/images/17.svg b/docs/publican-cloudstack/en-US/images/17.svg new file mode 100644 index 00000000000..ff29b7aa41b --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/17.svg @@ -0,0 +1,28 @@ + + + + + + 17 + diff --git a/docs/publican-cloudstack/en-US/images/18.png b/docs/publican-cloudstack/en-US/images/18.png new file mode 100644 index 00000000000..7e8dbb464e3 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/18.png differ diff --git a/docs/publican-cloudstack/en-US/images/18.svg b/docs/publican-cloudstack/en-US/images/18.svg new file mode 100644 index 00000000000..6225d8a91a5 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/18.svg @@ -0,0 +1,28 @@ + + + + + + 18 + diff --git a/docs/publican-cloudstack/en-US/images/19.png b/docs/publican-cloudstack/en-US/images/19.png new file mode 100644 index 00000000000..eb43c6fdca1 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/19.png differ diff --git a/docs/publican-cloudstack/en-US/images/19.svg b/docs/publican-cloudstack/en-US/images/19.svg new file mode 100644 index 00000000000..efd3c0eeb91 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/19.svg @@ -0,0 +1,28 @@ + + + + + + 19 + diff --git a/docs/publican-cloudstack/en-US/images/2.png b/docs/publican-cloudstack/en-US/images/2.png new file mode 100644 index 00000000000..e550c21cb11 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/2.png differ diff --git a/docs/publican-cloudstack/en-US/images/2.svg b/docs/publican-cloudstack/en-US/images/2.svg new file mode 100644 index 00000000000..27100aca9fa --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/2.svg @@ -0,0 +1,28 @@ + + + + + + 2 + diff --git a/docs/publican-cloudstack/en-US/images/20.png b/docs/publican-cloudstack/en-US/images/20.png new file mode 100644 index 00000000000..692badc3cd1 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/20.png differ diff --git a/docs/publican-cloudstack/en-US/images/20.svg b/docs/publican-cloudstack/en-US/images/20.svg new file mode 100644 index 00000000000..7d727359a3c --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/20.svg @@ -0,0 +1,28 @@ + + + + + + 20 + diff --git a/docs/publican-cloudstack/en-US/images/21.png b/docs/publican-cloudstack/en-US/images/21.png new file mode 100644 index 00000000000..231735e5aa9 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/21.png differ diff --git a/docs/publican-cloudstack/en-US/images/21.svg b/docs/publican-cloudstack/en-US/images/21.svg new file mode 100644 index 00000000000..babe3ad790b --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/21.svg @@ -0,0 +1,28 @@ + + + + + + 21 + diff --git a/docs/publican-cloudstack/en-US/images/22.png b/docs/publican-cloudstack/en-US/images/22.png new file mode 100644 index 00000000000..a77ea0faa5b Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/22.png differ diff --git a/docs/publican-cloudstack/en-US/images/22.svg b/docs/publican-cloudstack/en-US/images/22.svg new file mode 100644 index 00000000000..d7c7af500df --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/22.svg @@ -0,0 +1,28 @@ + + + + + + 22 + diff --git a/docs/publican-cloudstack/en-US/images/23.png b/docs/publican-cloudstack/en-US/images/23.png new file mode 100644 index 00000000000..1802579ef90 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/23.png differ diff --git a/docs/publican-cloudstack/en-US/images/23.svg b/docs/publican-cloudstack/en-US/images/23.svg new file mode 100644 index 00000000000..399deffb410 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/23.svg @@ -0,0 +1,28 @@ + + + + + + 23 + diff --git a/docs/publican-cloudstack/en-US/images/24.png b/docs/publican-cloudstack/en-US/images/24.png new file mode 100644 index 00000000000..16e96e7e68b Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/24.png differ diff --git a/docs/publican-cloudstack/en-US/images/24.svg b/docs/publican-cloudstack/en-US/images/24.svg new file mode 100644 index 00000000000..25a37e8dc81 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/24.svg @@ -0,0 +1,28 @@ + + + + + + 24 + diff --git a/docs/publican-cloudstack/en-US/images/25.png b/docs/publican-cloudstack/en-US/images/25.png new file mode 100644 index 00000000000..7bfac576852 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/25.png differ diff --git a/docs/publican-cloudstack/en-US/images/25.svg b/docs/publican-cloudstack/en-US/images/25.svg new file mode 100644 index 00000000000..adfb67af3e4 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/25.svg @@ -0,0 +1,28 @@ + + + + + + 25 + diff --git a/docs/publican-cloudstack/en-US/images/26.png b/docs/publican-cloudstack/en-US/images/26.png new file mode 100644 index 00000000000..08de0655857 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/26.png differ diff --git a/docs/publican-cloudstack/en-US/images/26.svg b/docs/publican-cloudstack/en-US/images/26.svg new file mode 100644 index 00000000000..6e8e5d62b8d --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/26.svg @@ -0,0 +1,28 @@ + + + + + + 26 + diff --git a/docs/publican-cloudstack/en-US/images/27.png b/docs/publican-cloudstack/en-US/images/27.png new file mode 100644 index 00000000000..ac73b8eebd5 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/27.png differ diff --git a/docs/publican-cloudstack/en-US/images/27.svg b/docs/publican-cloudstack/en-US/images/27.svg new file mode 100644 index 00000000000..299194e4483 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/27.svg @@ -0,0 +1,28 @@ + + + + + + 27 + diff --git a/docs/publican-cloudstack/en-US/images/28.png b/docs/publican-cloudstack/en-US/images/28.png new file mode 100644 index 00000000000..dddaea9e4f8 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/28.png differ diff --git a/docs/publican-cloudstack/en-US/images/28.svg b/docs/publican-cloudstack/en-US/images/28.svg new file mode 100644 index 00000000000..5df71b85554 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/28.svg @@ -0,0 +1,28 @@ + + + + + + 28 + diff --git a/docs/publican-cloudstack/en-US/images/29.png b/docs/publican-cloudstack/en-US/images/29.png new file mode 100644 index 00000000000..f901971df43 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/29.png differ diff --git a/docs/publican-cloudstack/en-US/images/29.svg b/docs/publican-cloudstack/en-US/images/29.svg new file mode 100644 index 00000000000..88aa692be43 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/29.svg @@ -0,0 +1,28 @@ + + + + + + 29 + diff --git a/docs/publican-cloudstack/en-US/images/3.png b/docs/publican-cloudstack/en-US/images/3.png new file mode 100644 index 00000000000..e78d18cb51d Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/3.png differ diff --git a/docs/publican-cloudstack/en-US/images/3.svg b/docs/publican-cloudstack/en-US/images/3.svg new file mode 100644 index 00000000000..7954fa5a0df --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/3.svg @@ -0,0 +1,28 @@ + + + + + + 3 + diff --git a/docs/publican-cloudstack/en-US/images/4.png b/docs/publican-cloudstack/en-US/images/4.png new file mode 100644 index 00000000000..525915d6690 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/4.png differ diff --git a/docs/publican-cloudstack/en-US/images/4.svg b/docs/publican-cloudstack/en-US/images/4.svg new file mode 100644 index 00000000000..c97f7658a53 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/4.svg @@ -0,0 +1,28 @@ + + + + + + 4 + diff --git a/docs/publican-cloudstack/en-US/images/5.png b/docs/publican-cloudstack/en-US/images/5.png new file mode 100644 index 00000000000..10ec8807650 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/5.png differ diff --git a/docs/publican-cloudstack/en-US/images/5.svg b/docs/publican-cloudstack/en-US/images/5.svg new file mode 100644 index 00000000000..64504469387 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/5.svg @@ -0,0 +1,28 @@ + + + + + + 5 + diff --git a/docs/publican-cloudstack/en-US/images/6.png b/docs/publican-cloudstack/en-US/images/6.png new file mode 100644 index 00000000000..60c626b3eda Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/6.png differ diff --git a/docs/publican-cloudstack/en-US/images/6.svg b/docs/publican-cloudstack/en-US/images/6.svg new file mode 100644 index 00000000000..45af47a1cdc --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/6.svg @@ -0,0 +1,28 @@ + + + + + + 6 + diff --git a/docs/publican-cloudstack/en-US/images/7.png b/docs/publican-cloudstack/en-US/images/7.png new file mode 100644 index 00000000000..7184e2c0d4c Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/7.png differ diff --git a/docs/publican-cloudstack/en-US/images/7.svg b/docs/publican-cloudstack/en-US/images/7.svg new file mode 100644 index 00000000000..2e9ffec9866 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/7.svg @@ -0,0 +1,28 @@ + + + + + + 7 + diff --git a/docs/publican-cloudstack/en-US/images/8.png b/docs/publican-cloudstack/en-US/images/8.png new file mode 100644 index 00000000000..d951846e9fb Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/8.png differ diff --git a/docs/publican-cloudstack/en-US/images/8.svg b/docs/publican-cloudstack/en-US/images/8.svg new file mode 100644 index 00000000000..340dbce58e3 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/8.svg @@ -0,0 +1,28 @@ + + + + + + 8 + diff --git a/docs/publican-cloudstack/en-US/images/9.png b/docs/publican-cloudstack/en-US/images/9.png new file mode 100644 index 00000000000..5aef6797585 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/9.png differ diff --git a/docs/publican-cloudstack/en-US/images/9.svg b/docs/publican-cloudstack/en-US/images/9.svg new file mode 100644 index 00000000000..3838627082f --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/9.svg @@ -0,0 +1,28 @@ + + + + + + 9 + diff --git a/docs/publican-cloudstack/en-US/images/dot.png b/docs/publican-cloudstack/en-US/images/dot.png new file mode 100644 index 00000000000..79908d10d4f Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/dot.png differ diff --git a/docs/publican-cloudstack/en-US/images/dot.svg b/docs/publican-cloudstack/en-US/images/dot.svg new file mode 100644 index 00000000000..eaeff2ea78b --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/dot.svg @@ -0,0 +1,21 @@ + + + + dot + diff --git a/docs/publican-cloudstack/en-US/images/dot2.png b/docs/publican-cloudstack/en-US/images/dot2.png new file mode 100644 index 00000000000..d9262efbf62 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/dot2.png differ diff --git a/docs/publican-cloudstack/en-US/images/dot2.svg b/docs/publican-cloudstack/en-US/images/dot2.svg new file mode 100644 index 00000000000..893f6893566 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/dot2.svg @@ -0,0 +1,21 @@ + + + + dot2 + diff --git a/docs/publican-cloudstack/en-US/images/h1-bg.png b/docs/publican-cloudstack/en-US/images/h1-bg.png new file mode 100644 index 00000000000..a2aad24b329 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/h1-bg.png differ diff --git a/docs/publican-cloudstack/en-US/images/h1-bg.svg b/docs/publican-cloudstack/en-US/images/h1-bg.svg new file mode 100644 index 00000000000..ebadc21d2d5 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/h1-bg.svg @@ -0,0 +1,21 @@ + + + + h1-bg + diff --git a/docs/publican-cloudstack/en-US/images/image_left.png b/docs/publican-cloudstack/en-US/images/image_left.png new file mode 100644 index 00000000000..007f7b3578c Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/image_left.png differ diff --git a/docs/publican-cloudstack/en-US/images/image_left.svg b/docs/publican-cloudstack/en-US/images/image_left.svg new file mode 100644 index 00000000000..99ce61cfc12 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/image_left.svg @@ -0,0 +1,331 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/publican-cloudstack/en-US/images/image_right.png b/docs/publican-cloudstack/en-US/images/image_right.png new file mode 100644 index 00000000000..5b67443c2cc Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/image_right.png differ diff --git a/docs/publican-cloudstack/en-US/images/image_right.svg b/docs/publican-cloudstack/en-US/images/image_right.svg new file mode 100644 index 00000000000..7c9e01f99f1 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/image_right.svg @@ -0,0 +1,21 @@ + + + + image_right + diff --git a/docs/publican-cloudstack/en-US/images/important.png b/docs/publican-cloudstack/en-US/images/important.png new file mode 100644 index 00000000000..969562b7bc7 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/important.png differ diff --git a/docs/publican-cloudstack/en-US/images/important.svg b/docs/publican-cloudstack/en-US/images/important.svg new file mode 100644 index 00000000000..064c783b538 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/important.svg @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/docs/publican-cloudstack/en-US/images/note.png b/docs/publican-cloudstack/en-US/images/note.png new file mode 100644 index 00000000000..d04775d9905 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/note.png differ diff --git a/docs/publican-cloudstack/en-US/images/note.svg b/docs/publican-cloudstack/en-US/images/note.svg new file mode 100644 index 00000000000..abe5a602468 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/note.svg @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/docs/publican-cloudstack/en-US/images/stock-go-back.png b/docs/publican-cloudstack/en-US/images/stock-go-back.png new file mode 100644 index 00000000000..00850b21b23 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/stock-go-back.png differ diff --git a/docs/publican-cloudstack/en-US/images/stock-go-back.svg b/docs/publican-cloudstack/en-US/images/stock-go-back.svg new file mode 100644 index 00000000000..b3b908143f6 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/stock-go-back.svg @@ -0,0 +1,21 @@ + + + + stock-go-back + diff --git a/docs/publican-cloudstack/en-US/images/stock-go-forward.png b/docs/publican-cloudstack/en-US/images/stock-go-forward.png new file mode 100644 index 00000000000..cc2797a4686 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/stock-go-forward.png differ diff --git a/docs/publican-cloudstack/en-US/images/stock-go-forward.svg b/docs/publican-cloudstack/en-US/images/stock-go-forward.svg new file mode 100644 index 00000000000..7ee607b48f9 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/stock-go-forward.svg @@ -0,0 +1,21 @@ + + + + stock-go-forward + diff --git a/docs/publican-cloudstack/en-US/images/stock-go-up.png b/docs/publican-cloudstack/en-US/images/stock-go-up.png new file mode 100644 index 00000000000..1ebf2799c35 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/stock-go-up.png differ diff --git a/docs/publican-cloudstack/en-US/images/stock-go-up.svg b/docs/publican-cloudstack/en-US/images/stock-go-up.svg new file mode 100644 index 00000000000..a7c2af2f15a --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/stock-go-up.svg @@ -0,0 +1,21 @@ + + + + stock-go-up + diff --git a/docs/publican-cloudstack/en-US/images/stock-home.png b/docs/publican-cloudstack/en-US/images/stock-home.png new file mode 100644 index 00000000000..3f0c1906343 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/stock-home.png differ diff --git a/docs/publican-cloudstack/en-US/images/stock-home.svg b/docs/publican-cloudstack/en-US/images/stock-home.svg new file mode 100644 index 00000000000..d06a54480e9 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/stock-home.svg @@ -0,0 +1,21 @@ + + + + stock-home + diff --git a/docs/publican-cloudstack/en-US/images/title_logo.png b/docs/publican-cloudstack/en-US/images/title_logo.png new file mode 100644 index 00000000000..f0b1d20c677 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/title_logo.png differ diff --git a/docs/publican-cloudstack/en-US/images/title_logo.svg b/docs/publican-cloudstack/en-US/images/title_logo.svg new file mode 100644 index 00000000000..e8b3eca8d82 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/title_logo.svg @@ -0,0 +1,335 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +open source cloud computing + + + + + \ No newline at end of file diff --git a/docs/publican-cloudstack/en-US/images/warning.png b/docs/publican-cloudstack/en-US/images/warning.png new file mode 100644 index 00000000000..94b69d1ff1f Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/warning.png differ diff --git a/docs/publican-cloudstack/en-US/images/warning.svg b/docs/publican-cloudstack/en-US/images/warning.svg new file mode 100644 index 00000000000..4231e5ac041 --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/warning.svg @@ -0,0 +1,130 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/publican-cloudstack/en-US/images/watermark-draft.png b/docs/publican-cloudstack/en-US/images/watermark-draft.png new file mode 100644 index 00000000000..0ead5af8bb8 Binary files /dev/null and b/docs/publican-cloudstack/en-US/images/watermark-draft.png differ diff --git a/docs/publican-cloudstack/en-US/images/watermark-draft.svg b/docs/publican-cloudstack/en-US/images/watermark-draft.svg new file mode 100644 index 00000000000..4ecbf37fecf --- /dev/null +++ b/docs/publican-cloudstack/en-US/images/watermark-draft.svg @@ -0,0 +1,21 @@ + + + + watermark-draft + diff --git a/docs/publican-cloudstack/publican-cloudstack.spec b/docs/publican-cloudstack/publican-cloudstack.spec new file mode 100644 index 00000000000..f1f3c7d8780 --- /dev/null +++ b/docs/publican-cloudstack/publican-cloudstack.spec @@ -0,0 +1,46 @@ +%define brand cloudstack + +Name: publican-cloudstack +Summary: Common documentation files for %{brand} +Version: 0.2 +Release: 1%{?dist} +License: ASLv2 +Group: Applications/Text +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Buildarch: noarch +Source: %{name}-%{version}.tgz +Requires: publican >= 1.99 +BuildRequires: publican >= 1.99 +URL: http://cloudstack.org + +%description +This package provides common files and templates needed to build documentation +for %{brand} with publican. + +%prep +%setup -qn %{name} + +%build +publican build --formats=xml --langs=en-US --publish + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p -m755 $RPM_BUILD_ROOT%{_datadir}/publican/Common_Content +publican install_brand --path=$RPM_BUILD_ROOT%{_datadir}/publican/Common_Content + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc README +%doc LICENSE +%doc NOTICE +%{_datadir}/publican/Common_Content/%{brand} + +%changelog +* Tue Jun 26 2012 David Nalley 0.2-1 +- updated for ASF move +* Sat Aug 11 2011 David Nalley 0.1-1 +- Created Brand + diff --git a/docs/runbook/README b/docs/runbook/README new file mode 100644 index 00000000000..88d1482bf3f --- /dev/null +++ b/docs/runbook/README @@ -0,0 +1,19 @@ +Welcome. + +This file will talk about hacking on the Runbook document. + +The document itself is written using DocBook XML with a publishing tool +called Publican. You can find more about publican at: +http://fedorahosted.org/publican + +In addition to needing publican - you will also need the CloudStack brand +for publican. This package contains all of the standard legal disclaimers, +logos, etc, to 'brand' the document as part of Apache CloudStack project. + +In CloudStack's source repo that is located at docs/publican-cloudstack. + +Patches are encouraged and welcome; as are forks! If you want to take this Runbook +as a base and extend it to a different hypervisor, or a different networking model +or something else entirely, please do so. + +--David diff --git a/docs/runbook/en-US/Author_Group.xml b/docs/runbook/en-US/Author_Group.xml new file mode 100644 index 00000000000..65080cf74fb --- /dev/null +++ b/docs/runbook/en-US/Author_Group.xml @@ -0,0 +1,32 @@ + + +%BOOK_ENTITIES; +]> + + + + + + + Apache + CloudStack + + + diff --git a/docs/runbook/en-US/Book_Info.xml b/docs/runbook/en-US/Book_Info.xml new file mode 100644 index 00000000000..8e06d62b258 --- /dev/null +++ b/docs/runbook/en-US/Book_Info.xml @@ -0,0 +1,52 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Runbook + Prescriptive instructions for deploying Apache CloudStack + Apache CloudStack + 3.0.2 + 0 + 0 + + + These runbooks are designed to provide a strict environment to guarantee + a higher degree of success in initial deployments of Apache CloudStack. + All of the elements of the environment will be provided to you. + Apache CloudStack is capable of much more complex configurations, + but they are beyond the scope of this document. + + + + + + + + + + + + + diff --git a/docs/runbook/en-US/Chapter.xml b/docs/runbook/en-US/Chapter.xml new file mode 100644 index 00000000000..30894e7814b --- /dev/null +++ b/docs/runbook/en-US/Chapter.xml @@ -0,0 +1,53 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Test Chapter + + This is a test paragraph + +
+ Test Section 1 + + This is a test paragraph in a section + +
+ +
+ Test Section 2 + + This is a test paragraph in Section 2 + + + + listitem text + + + + +
+ +
+ diff --git a/docs/runbook/en-US/Environment.xml b/docs/runbook/en-US/Environment.xml new file mode 100644 index 00000000000..9048e1aa0a2 --- /dev/null +++ b/docs/runbook/en-US/Environment.xml @@ -0,0 +1,244 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Environment + + Before you begin, you need to prepare the environment before you install CloudStack. + We will go over the steps to prepare now. + +
+ Operating System + + Using the CentOS 6.2 x86_64 minimal install ISO, you'll need to install CentOS + on your hardware. The defaults will generally be acceptable for this installation. + + + Once this installation is complete, you'll want to connect to your freshly + installed machine via SSH as the root user. Note that you should not allow root + logins in a production environment, so be sure to turn off remote logins once you + have finished the installation and configuration. + +
+ Configuring the network + + By default the network will not come up on your hardware and you + will need to configure it to work in your environment. Since we + specified that there will be no DHCP server in this environment + we will be manually configuring your network interface. We will + assume, for the purposes of this exercise, that eth0 is the only network + interface that will be connected and used. + + + Connecting via the console you should login as root. Check the + file /etc/sysconfig/network-scripts/ifcfg-eth0, + it will look like this by default: + +DEVICE="eth0" +HWADDR="52:54:00:B9:A6:C0" +NM_CONTROLLED="yes" +ONBOOT="no" + + + + Unfortunately, this configuration will not permit you to connect to the network, + and is also unsuitable for our purposes with CloudStack. We want to + configure that file so that it specifies the IP address, netmask, etc., as shown + in the following example: + + +DEVICE=eth0 +HWADDR=52:54:00:B9:A6:C0 +NM_CONTROLLED=no +ONBOOT=yes +BOOTPROTO=none +IPADDR=172.16.10.2 +NETMASK=255.255.255.0 +GATEWAY=172.16.10.1 + + + IP Addressing + Throughout this document we are assuming that you will + have a /24 network for your CloudStack implementation. This can be any + RFC 1918 network. However, we are assuming that you will match the + machine address that we are using. Thus we may use + 172.16.10.2 and because + you might be using the 192.168.55.0/24 network you would use + 192.168.55.2 + + + + Hardware Addresses + You should not use the hardware address (aka MAC address) from our example + for your configuration. It is network interface specific, so you should keep the + address already provided in the HWADDR directive. + + + Now that we have the configuration files properly set up, we need to run a + few commands to start up the network + # chkconfig network on + # service network start + This should bring the network up successfully, but we now need to enable name resolution. + To do that we will edit /etc/resolv.conf. These instructions will add + one of the nameservers from Google, though you are free to add a local nameserver if you wish. + Your /etc/resolv.conf should modified to look like: + + +nameserver 8.8.8.8 + + +
+
+ Hostname + + Cloudstack requires that the hostname be properly set. If you used the default + options in the installation, then your hostname is currently set to + localhost.localdomain. To test this we will run: + # hostname --fqdn + At this point it will likely return: + localhost + To rectify this situation - we'll set the hostname by editing the + /etc/hosts file so that it follows a similar format to this example: +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +172.16.10.2 srvr1.cloud.priv + + + After you've modified that file, go ahead and restart the network using: +# service network restart + Now recheck with the hostname --fqdn command and ensure that it returns + a FQDN response +
+
+ SELinux + At the moment, for CloudStack to work properly SELinux must be + set to permissive. We want to both configure this for future boots and modify it + in the current running system. + + To configure SELinux to be permissive in the running system we need to run + the following command: + # setenforce 0 + + To ensure that it remains in that state we need to configure the file + /etc/selinux/config to reflect the permissive state, + as shown in this example: + + +# This file controls the state of SELinux on the system. +# SELINUX= can take one of these three values: +# enforcing - SELinux security policy is enforced. +# permissive - SELinux prints warnings instead of enforcing. +# disabled - No SELinux policy is loaded. +SELINUX=permissive +# SELINUXTYPE= can take one of these two values: +# targeted - Targeted processes are protected, +# mls - Multi Level Security protection. +SELINUXTYPE=targeted + + +
+
+ NTP + NTP configuration is a necessity for keeping all of the clocks in your cloud + servers in sync. However, NTP is not installed by default. So we'll install and + and configure NTP at this stage. Installation is accomplished as follows: + + # yum install ntp + The actual default configuration is fine for our purposes, so we merely need to + enable it and set it to start on boot as follows: + # chkconfig ntpd on + # service ntpd start +
+
+
+ NFS + + Our configuration is going to use NFS for both primary and secondary + storage. We are going to go ahead and setup two NFS shares for those + purposes. We'll start out by installing + nfs-utils. + + # yum install nfs-utils + + We now need to configure NFS to serve up two different shares. This is handled comparatively easily + in the /etc/exports file. You should ensure that it has the following content: + + +/secondary *(rw,async,no_root_squash) +/primary *(rw,async,no_root_squash) + + + You will note that we specified two directories that don't exist (yet) on the system. + We'll go ahead and create those directories and set permissions appropriately on them with the following commands: + + +# mkdir /primary +# mkdir /secondary +# chmod 777 /primary +# chmod 777 /secondary + + CentOS 6.x releases use NFSv4 by default. NFSv4 requires that domain setting matches on all clients. + In our case, the domain is cloud.priv, so ensure that the domain setting in /etc/idmapd.conf + is uncommented and set as follows: + Domain = cloud.priv + Now you'll need uncomment the configuration values in the file /etc/sysconfig/nfs + +LOCKD_TCPPORT=32803 +LOCKD_UDPPORT=32769 +MOUNTD_PORT=892 +RQUOTAD_PORT=875 +STATD_PORT=662 +STATD_OUTGOING_PORT=2020 + + Now we need to configure the firewall to permit incoming NFS connections. + Edit the file /etc/sysconfig/iptables + + +-A INPUT -m state --state NEW -p udp --dport 111 -j ACCEPT +-A INPUT -m state --state NEW -p tcp --dport 111 -j ACCEPT +-A INPUT -m state --state NEW -p tcp --dport 2049 -j ACCEPT +-A INPUT -m state --state NEW -p tcp --dport 32803 -j ACCEPT +-A INPUT -m state --state NEW -p udp --dport 32769 -j ACCEPT +-A INPUT -m state --state NEW -p tcp --dport 892 -j ACCEPT +-A INPUT -m state --state NEW -p udp --dport 892 -j ACCEPT +-A INPUT -m state --state NEW -p tcp --dport 875 -j ACCEPT +-A INPUT -m state --state NEW -p udp --dport 875 -j ACCEPT +-A INPUT -m state --state NEW -p tcp --dport 662 -j ACCEPT +-A INPUT -m state --state NEW -p udp --dport 662 -j ACCEPT + + Now you can restart the iptables service with the following command: + + # service iptables restart + We now need to configure nfs service to start on boot and actually start it on the host by + executing the following commands: + + # service rpcbind start + # service nfs start + # chkconfig rpcbind on + # chkconfig nfs on + +
+ + +
diff --git a/docs/runbook/en-US/Management.xml b/docs/runbook/en-US/Management.xml new file mode 100644 index 00000000000..d95108e2ee1 --- /dev/null +++ b/docs/runbook/en-US/Management.xml @@ -0,0 +1,127 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Installation of the management server + + Now it is time to start installing CloudStack's management server + and some of the related components. + +
+ Database Installation and Configuration + + We'll start out by installing MySQL and configuring + some options to ensure CloudStack runs well. + + + To install MySQL run the following command: + # yum -y install mysql-server + + With MySQL installed we need to make + a few configuration changes to /etc/my.cnf. + Specifically we need to add the following options to the [mysqld] section: + +innodb_rollback_on_timeout=1 +innodb_lock_wait_timeout=600 +max_connections=350 +log-bin=mysql-bin +binlog-format = 'ROW' + + + + Now that MySQL is properly configured we can + start it and configure it to start on boot as follows: + + # service mysqld start + # chkconfig mysqld on + + + +
+ +
+ Extraction + + The next step is to extract the contents of the CloudStack tarball + (mentioned in ) you + downloaded previously. To extract the contents of this tarball use + the following command: + + + # tar -xzvf CloudStack-oss-3.0.2-1-rhel6.2.tar.gz + + For the next few sections you'll need to cd into the first level that was just created. + +
+
+ Installation + Now that you are in the directory created by extracting the tarball, it's now time to install. We'll run + ./install.sh and choose option . This will install the management server + and necessary dependencies. + + With the application itself installed we can now setup the database, we'll do that with the following command + and options: + + + # cloud-setup-databases cloud:password@localhost --deploy-as=root + + When this process is finished, you should see a message like "CloudStack has successfully initialized the database." + + Now that the database has been created, we can take the final step in setting up the management server by issuing the following command: + + # cloud-setup-mangament + +
+
+ System Template Setup + CloudStack uses a number of system VMs to provide functionality for + accessing the console of virtual machines, providing various networking + services, and managing various aspects of storage. This step will + acquire those system images ready for deployment when we bootstrap + your cloud. + + + The place we are going to download these images to is the secondary + storage share that we setup earlier, so we'll need to mount that share + with the mount command run on the management server: + + + # mount -t nfs 172.16.10.2:/secondary /mnt/secondary + + + Now we need to download the system VM template and deploy that to the + share we just mounted. The management server includes a script to properly + manipulate the system VMs images. + + + # /usr/lib64/cloud/agent/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2 -h kvm -F + + + That concludes our setup of the management server. We still need to + configure CloudStack, but we will do that after we get our hypervisor + set up. + +
+
diff --git a/docs/runbook/en-US/Overview.xml b/docs/runbook/en-US/Overview.xml new file mode 100644 index 00000000000..9b64f05e9c5 --- /dev/null +++ b/docs/runbook/en-US/Overview.xml @@ -0,0 +1,100 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Overview + + Infrastructure-as-a-Service (IaaS) clouds can be a complex thing to build, + and by definition they have a plethora of options, which often lead to confusion + for even experienced admins who are newcomers to building cloud platforms. + The goal for this runbook is to provide a straightforward set of instructions + to get you up and running with CloudStack with a minimum amount of trouble. + +
+ What exactly are we building? + + This runbook will focus on building a CloudStack cloud using KVM with + CentOS 6.2 with NFS storage on a flat layer-2 network utilizing + layer-3 network isolation (aka Security Groups), and doing it all + on a single piece of hardware. + + + KVM, or Kernel-based Virtual Machine is a virtualization technology + for the Linux kernel. KVM supports native virtualization atop + processors with hardware virtualization extensions. + + + Security Groups act as distributed firewalls that control access + to a group of virtual machines. + +
+
+ High level overview of the process + + Before we actually get to installing CloudStack, we'll start with + installing our base operating system, and then configuring that to act + as an NFS server for several types of storage. We'll install the + management server, download the systemVMs, and finally install the agent + software. Finally we'll spend a good deal of time configuring the entire + cloud in the CloudStack web interface. + +
+
+ Prerequisites + + To complete this runbook you'll need the following items: + + + + At least one computer which supports hardware virtualization. + + + + + The + + CentOS 6.2 x86_64 minimal install CD + + + + + + A /24 network with the gateway being at xxx.xxx.xxx.1, no DHCP should be on this network and + none of the computers running CloudStack may have a dynamic address. + + + + + Copy of + + CloudStack 3.0.2 for RHEL and CentOS 6.2 + + + + + +
+ +
diff --git a/docs/runbook/en-US/Preface.xml b/docs/runbook/en-US/Preface.xml new file mode 100644 index 00000000000..3d26d43d8c5 --- /dev/null +++ b/docs/runbook/en-US/Preface.xml @@ -0,0 +1,33 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Preface + + + + + + diff --git a/docs/runbook/en-US/Revision_History.xml b/docs/runbook/en-US/Revision_History.xml new file mode 100644 index 00000000000..dba81ca7a73 --- /dev/null +++ b/docs/runbook/en-US/Revision_History.xml @@ -0,0 +1,42 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Revision History + + + + 0-0 + Mon Jun 25 2012 + + + Initial creation of book by publican + + + + + + + diff --git a/docs/runbook/en-US/Runbook.ent b/docs/runbook/en-US/Runbook.ent new file mode 100644 index 00000000000..535d45aac3c --- /dev/null +++ b/docs/runbook/en-US/Runbook.ent @@ -0,0 +1,4 @@ + + + + diff --git a/docs/runbook/en-US/Runbook.xml b/docs/runbook/en-US/Runbook.xml new file mode 100644 index 00000000000..667956bbf7e --- /dev/null +++ b/docs/runbook/en-US/Runbook.xml @@ -0,0 +1,37 @@ + + +%BOOK_ENTITIES; +]> + + + + + + + + + + + + + + + + diff --git a/docs/runbook/en-US/config.xml b/docs/runbook/en-US/config.xml new file mode 100644 index 00000000000..5f246031426 --- /dev/null +++ b/docs/runbook/en-US/config.xml @@ -0,0 +1,179 @@ + + +%BOOK_ENTITIES; +]> + + + + + + Configuration + + As we noted before we will be using security groups to provide isolation + and by default that implies that we'll be using a flat layer-2 network. + It also means that the simplicity of our setup means that we can use the + quick installer. + +
+ UI Access + + To get access to CloudStack's web interface, merely point your + browser to http://172.16.10.2:8080/client + The default username is 'admin', and the default password is 'password'. + You should see a splash screen that allows you to choose several options + for setting up CloudStack. You should choose the + option. + + + You should now see a prompt requiring you to change the password for + the admin user. Please do so. + +
+
+ Setting up a Zone + + A zone is the largest organization entity in CloudStack - and we'll be creating one, this + should be the screen that you see in front of you now. And for us there are 5 pieces of + information that we need. + + + Name - we will set this to the ever-descriptive 'Zone1' for our cloud. + + + Public DNS 1 - we will set this to '8.8.8.8' for our cloud. + + + Public DNS 2 - we will set this to '8.8.4.4' for our cloud. + + + Internal DNS1 - we will also set this to '8.8.8.8' for our cloud. + + + Internal DNS2 - we will also set this to '8.8.8.4' for our cloud. + + + + + Notes about DNS settings + + CloudStack distinguishes between internal and public DNS. Internal + DNS is assumed to be capable of resolving internal-only + hostnames, such as your NFS server’s DNS name. Public DNS is + provided to the guest VMs to resolve public IP addresses. You can + enter the same DNS server for both types, but if you do so, you + must make sure that both internal and public IP addresses can + route to the DNS server. In our specific case we will not use any + names for resources internally, and we have indeed them set to look + to the same external resource so as to not add a namerserver setup + to our list of requirements. + + +
+
+ Pod Configuration + Now that we've added a Zone, the next step that comes up is a prompt + for information regading a pod. Which is looking for 4 items. + + + Name - We'll use Pod1 for our cloud. + + + Gateway - We'll use 172.16.10.1 as our gateway + + + Netmask - We'll use 255.255.255.0 + + + Start/end reserved system IPs - we will use 172.16.10.10-172.16.10.20 + + + Guest gateway - We'll use 172.16.10.1 + + + Guest netmask - We'll use 255.255.255.0 + + + Guest start/end IP - We'll use 172.16.10.30-172.16.10.200 + + + +
+
+ Cluster + Now that we've added a Zone, we need only add a few more items for configuring the cluster. + + + Name - We'll use Cluster1 + + + Hypervisor - If this is the first cluster, you may have already been prompted for which hypervisor you were going to use, in which case this will + be a read-only field. Otherwise choose KVM + + + + + You should be prompted to add the first host to your cluster at this point. Only a few bits of information are needed. + + + Hostname - we'll use the IP address 172.16.10.2 since we didn't set up a DNS server. + + + Username - we'll use 'root' + + + Password - enter the operating system password for the root user + + + Host tags - This is an optional field and we will leave it blank + + + +
+ Primary Storage + With you cluster now setup - you should be prompted for primary storage information. Choose NFS as the storage type and then enter the following values in the fields: + + + Server - We'll be using the IP address 172.16.10.2 + + + Path - Well define /primary as the path we are using + + + +
+
+ Secondary Storage + If this is a new zone, you'll be prompted for secondary storage information - populate it as follows: + + + NFS server - We'll use the IP address 172.16.10.2 + + + Path - We'll use /secondary + + + + Now, click Launch and your cloud should begin setup - it may take several minutes depending on your internet connection speed for setup to finalize. +
+
+ + +
+ diff --git a/docs/runbook/en-US/images/icon.svg b/docs/runbook/en-US/images/icon.svg new file mode 100644 index 00000000000..b2f16d0f61d --- /dev/null +++ b/docs/runbook/en-US/images/icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/runbook/en-US/kvm.xml b/docs/runbook/en-US/kvm.xml new file mode 100644 index 00000000000..6f9fdad705a --- /dev/null +++ b/docs/runbook/en-US/kvm.xml @@ -0,0 +1,103 @@ + + +%BOOK_ENTITIES; +]> + + + + + + KVM Setup and installation + + KVM is the hypervisor we'll be using - we will recover the initial setup + which has already been done on the hypervisor host and cover installation + of the agent software, you can use the same steps to add additional KVM + nodes to your CloudStack environment. + +
+ Prerequisites + + We explicitly are using the management server as a compute node as well, + which means that we have already performed many of the prerequisite steps + when setting up the management server, but we will list them here for + clarity. Those steps are: + + + + + + + + + + + + + + + + + + + + + + + + + You shouldn't need to do that for the management server, of course, but + any additional hosts will need for you to complete the above steps. + +
+ +
+ Installation + + You'll need to ensure that you are in the directory that was created when + we extracted the the tarball. + + + + You'll be running ./install.sh again and this time + choosing which will install the software necessary for + managing a KVM node. + +
+
+ KVM Configuration + + KVM configuration is relatively simple at only a single item. We need to + edit the QEMU VNC configuration. This is done by editing + /etc/libvirt/qemu.conf and ensuring the following + line is present and uncommented. + vnc_listen=0.0.0.0 + + + You can now just restart the libvirt daemon by issuing the following command: + # service libvirt restart + + + That concludes our installation and configuration of KVM, and we'll now move to using the CloudStack UI + for the actual configuration of our cloud. + +
+ +
+ diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmObjectModule.py b/ovm/scripts/vm/hypervisor/ovm/OvmObjectModule.py deleted file mode 100644 index 0d21dae0e83..00000000000 --- a/ovm/scripts/vm/hypervisor/ovm/OvmObjectModule.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -''' -Created on May 17, 2011 - -@author: frank -''' - -class OvmObject(object): - pass \ No newline at end of file diff --git a/ovm/src/com/cloud/ovm/object/OvmDisk.java b/ovm/src/com/cloud/ovm/object/OvmDisk.java deleted file mode 100644 index 3e199cca97e..00000000000 --- a/ovm/src/com/cloud/ovm/object/OvmDisk.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.ovm.object; - - -public class OvmDisk extends OvmObject { - public static final String WRITE = "w"; - public static final String READ = "r"; - public static final String SHAREDWRITE = "w!"; - public static final String SHAREDREAD = "r!"; - - public static class Details { - public String type; - public String path; - public Boolean isIso; - } -} diff --git a/ovm/src/com/cloud/ovm/object/OvmObject.java b/ovm/src/com/cloud/ovm/object/OvmObject.java deleted file mode 100644 index 7676856e4a5..00000000000 --- a/ovm/src/com/cloud/ovm/object/OvmObject.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.ovm.object; - -public class OvmObject { -} diff --git a/ovm/src/com/cloud/ovm/object/OvmVif.java b/ovm/src/com/cloud/ovm/object/OvmVif.java deleted file mode 100644 index 9df214f268b..00000000000 --- a/ovm/src/com/cloud/ovm/object/OvmVif.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.ovm.object; - -public class OvmVif extends OvmObject { - public static final String NETFRONT = "netfront"; - public static final String IOEMU = "ioemu"; - - public static class Details { - public String name; - public String mac; - public String bridge; - public String type; - } - -} diff --git a/ovm/src/com/cloud/ovm/object/OvmVlan.java b/ovm/src/com/cloud/ovm/object/OvmVlan.java deleted file mode 100644 index d95dfb925a9..00000000000 --- a/ovm/src/com/cloud/ovm/object/OvmVlan.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.ovm.object; - -import org.apache.xmlrpc.XmlRpcException; - -public class OvmVlan extends OvmObject { - public static class Details { - public String name; - public int vid; - public String pif; - - public String toJson() { - return Coder.toJson(this); - } - } - - public static String create(Connection c, Details d) throws XmlRpcException { - Object[] params = {d.toJson()}; - String res = (String)c.call("OvmNetwork.createVlan", params); - Details ret = Coder.fromJson(res, Details.class); - return ret.name; - } - - public static void delete(Connection c, String name) throws XmlRpcException { - Object[] params = {name}; - c.call("OvmNetwork.deleteVlan", params); - } -} diff --git a/patches/systemvm/debian/buildsystemvm.sh b/patches/systemvm/debian/buildsystemvm.sh index dff86017d84..090a0827e6b 100755 --- a/patches/systemvm/debian/buildsystemvm.sh +++ b/patches/systemvm/debian/buildsystemvm.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. set -e diff --git a/patches/systemvm/debian/convert.sh b/patches/systemvm/debian/convert.sh index 4687fd821ce..27098a13445 100755 --- a/patches/systemvm/debian/convert.sh +++ b/patches/systemvm/debian/convert.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/patches/systemvm/debian/qemuconvert.sh b/patches/systemvm/debian/qemuconvert.sh index 19e3b9caf9d..dc8eb15b3ab 100755 --- a/patches/systemvm/debian/qemuconvert.sh +++ b/patches/systemvm/debian/qemuconvert.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/patches/systemvm/debian/vhdconvert.sh b/patches/systemvm/debian/vhdconvert.sh index e10b9b8966e..0b0dbfb1724 100755 --- a/patches/systemvm/debian/vhdconvert.sh +++ b/patches/systemvm/debian/vhdconvert.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/plugins/deployment-planners/user-concentrated-pod/.classpath b/plugins/deployment-planners/user-concentrated-pod/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/deployment-planners/user-concentrated-pod/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/deployment-planners/user-concentrated-pod/.project b/plugins/deployment-planners/user-concentrated-pod/.project new file mode 100755 index 00000000000..c0cec7eab2a --- /dev/null +++ b/plugins/deployment-planners/user-concentrated-pod/.project @@ -0,0 +1,17 @@ + + + user-concentrated-pod-dp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/deployment-planners/user-concentrated-pod/build.xml b/plugins/deployment-planners/user-concentrated-pod/build.xml new file mode 100755 index 00000000000..29d4595b4a2 --- /dev/null +++ b/plugins/deployment-planners/user-concentrated-pod/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/deploy/UserConcentratedPodPlanner.java b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java similarity index 100% rename from server/src/com/cloud/deploy/UserConcentratedPodPlanner.java rename to plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java diff --git a/plugins/deployment-planners/user-dispersing/.classpath b/plugins/deployment-planners/user-dispersing/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/deployment-planners/user-dispersing/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/deployment-planners/user-dispersing/.project b/plugins/deployment-planners/user-dispersing/.project new file mode 100755 index 00000000000..d9b2d401aa8 --- /dev/null +++ b/plugins/deployment-planners/user-dispersing/.project @@ -0,0 +1,17 @@ + + + user-dispersing + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.jdt.core.prefs b/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..d0ee7df1827 --- /dev/null +++ b/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Tue Jun 19 15:34:37 PDT 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/plugins/deployment-planners/user-dispersing/build.xml b/plugins/deployment-planners/user-dispersing/build.xml new file mode 100755 index 00000000000..ba72332586a --- /dev/null +++ b/plugins/deployment-planners/user-dispersing/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/deploy/UserDispersingPlanner.java b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java old mode 100644 new mode 100755 similarity index 100% rename from server/src/com/cloud/deploy/UserDispersingPlanner.java rename to plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java diff --git a/plugins/file-systems/netapp/.classpath b/plugins/file-systems/netapp/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/file-systems/netapp/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/file-systems/netapp/.project b/plugins/file-systems/netapp/.project new file mode 100644 index 00000000000..a4445c25081 --- /dev/null +++ b/plugins/file-systems/netapp/.project @@ -0,0 +1,17 @@ + + + netapp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/file-systems/netapp/build.xml b/plugins/file-systems/netapp/build.xml new file mode 100755 index 00000000000..6326e144f6a --- /dev/null +++ b/plugins/file-systems/netapp/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/api/commands/netapp/AssociateLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java similarity index 78% rename from server/src/com/cloud/api/commands/netapp/AssociateLunCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java index 290dff5a820..db317e06d65 100644 --- a/server/src/com/cloud/api/commands/netapp/AssociateLunCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.rmi.ServerException; diff --git a/server/src/com/cloud/api/commands/netapp/CreateLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java similarity index 78% rename from server/src/com/cloud/api/commands/netapp/CreateLunCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java index 3cea4d822bd..2e0eb86eb1b 100644 --- a/server/src/com/cloud/api/commands/netapp/CreateLunCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.rmi.ServerException; diff --git a/server/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java similarity index 84% rename from server/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java index 604d71d3a4d..a301deeed4a 100644 --- a/server/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.net.UnknownHostException; diff --git a/server/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java similarity index 74% rename from server/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java index d80150abcdc..020493b98d4 100644 --- a/server/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import org.apache.log4j.Logger; diff --git a/server/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java similarity index 73% rename from server/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java index 06c651f852d..de12511f0dd 100644 --- a/server/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; diff --git a/server/src/com/cloud/api/commands/netapp/DestroyLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java similarity index 73% rename from server/src/com/cloud/api/commands/netapp/DestroyLunCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java index 047c6fa3c34..76ccd0e5c3d 100644 --- a/server/src/com/cloud/api/commands/netapp/DestroyLunCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.rmi.ServerException; diff --git a/server/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java similarity index 77% rename from server/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java index 449c99cb909..4bde7f519b8 100644 --- a/server/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.rmi.ServerException; diff --git a/server/src/com/cloud/api/commands/netapp/DissociateLunCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java similarity index 74% rename from server/src/com/cloud/api/commands/netapp/DissociateLunCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java index 47848a1c2b6..77425cbe5ce 100644 --- a/server/src/com/cloud/api/commands/netapp/DissociateLunCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.rmi.ServerException; diff --git a/server/src/com/cloud/api/commands/netapp/ListLunsCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java similarity index 77% rename from server/src/com/cloud/api/commands/netapp/ListLunsCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java index 35325c294ec..1101648219a 100644 --- a/server/src/com/cloud/api/commands/netapp/ListLunsCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.util.ArrayList; diff --git a/server/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java similarity index 75% rename from server/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java index 9107c0af752..e6467393386 100644 --- a/server/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.util.ArrayList; diff --git a/server/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java similarity index 79% rename from server/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java index 7162abf2409..389053a36dc 100644 --- a/server/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; import java.util.ArrayList; diff --git a/server/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java similarity index 71% rename from server/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java rename to plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java index 4ad196d3a78..0bca2901dc7 100644 --- a/server/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java +++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.api.commands.netapp; diff --git a/server/src/com/cloud/netapp/LunVO.java b/plugins/file-systems/netapp/src/com/cloud/netapp/LunVO.java similarity index 69% rename from server/src/com/cloud/netapp/LunVO.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/LunVO.java index 03a9947c7f7..af2e5755516 100644 --- a/server/src/com/cloud/netapp/LunVO.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/LunVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp; import javax.persistence.Column; diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappAllocator.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappAllocator.java new file mode 100644 index 00000000000..0cc36298d24 --- /dev/null +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappAllocator.java @@ -0,0 +1,25 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.netapp; + + +public interface NetappAllocator{ + + public NetappVolumeVO chooseVolumeFromPool(String poolName, long lunSizeGb) ; + + public NetappVolumeVO chooseLeastFullVolumeFromPool(String poolName,long lunSizeGb); +} diff --git a/server/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java similarity index 80% rename from server/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java index 707c30ddbca..3692983bfb2 100644 --- a/server/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappDefaultAllocatorImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp; import java.io.IOException; diff --git a/server/src/com/cloud/netapp/NetappManager.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java similarity index 70% rename from server/src/com/cloud/netapp/NetappManager.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java index b7df9d237ba..7216c50f428 100644 --- a/server/src/com/cloud/netapp/NetappManager.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp; import java.net.UnknownHostException; diff --git a/server/src/com/cloud/netapp/NetappManagerImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java similarity index 97% rename from server/src/com/cloud/netapp/NetappManagerImpl.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java index 4b6ea969926..7dcb9d3d032 100644 --- a/server/src/com/cloud/netapp/NetappManagerImpl.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp; import java.io.IOException; diff --git a/server/src/com/cloud/netapp/NetappVolumeVO.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappVolumeVO.java similarity index 81% rename from server/src/com/cloud/netapp/NetappVolumeVO.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/NetappVolumeVO.java index ff6e47802d4..04318d00190 100644 --- a/server/src/com/cloud/netapp/NetappVolumeVO.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappVolumeVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp; import javax.persistence.Column; diff --git a/server/src/com/cloud/netapp/PoolVO.java b/plugins/file-systems/netapp/src/com/cloud/netapp/PoolVO.java similarity index 54% rename from server/src/com/cloud/netapp/PoolVO.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/PoolVO.java index f16aa90fd59..713db46ee54 100644 --- a/server/src/com/cloud/netapp/PoolVO.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/PoolVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp; import javax.persistence.Column; diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDao.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDao.java new file mode 100644 index 00000000000..24086ef0208 --- /dev/null +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDao.java @@ -0,0 +1,31 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.netapp.dao; + +import java.util.List; + +import com.cloud.netapp.LunVO; +import com.cloud.netapp.NetappVolumeVO; +import com.cloud.netapp.PoolVO; +import com.cloud.utils.db.GenericDao; + +public interface LunDao extends GenericDao { + + List listLunsByVolId(Long volId); + + LunVO findByName(String name); +} diff --git a/server/src/com/cloud/netapp/dao/LunDaoImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java similarity index 66% rename from server/src/com/cloud/netapp/dao/LunDaoImpl.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java index ccf2bd39dd4..9cc67b7e894 100644 --- a/server/src/com/cloud/netapp/dao/LunDaoImpl.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/LunDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp.dao; import java.util.List; diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDao.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDao.java new file mode 100644 index 00000000000..18cebe9edfc --- /dev/null +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDao.java @@ -0,0 +1,28 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.netapp.dao; + +import java.util.List; + +import com.cloud.netapp.PoolVO; +import com.cloud.utils.db.GenericDao; + +public interface PoolDao extends GenericDao { + + PoolVO findPool(String poolName); + List listPools(); +} diff --git a/server/src/com/cloud/netapp/dao/PoolDaoImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java similarity index 62% rename from server/src/com/cloud/netapp/dao/PoolDaoImpl.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java index ac5c6fbbe4b..3e23644840d 100644 --- a/server/src/com/cloud/netapp/dao/PoolDaoImpl.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/PoolDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp.dao; import java.util.List; diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDao.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDao.java new file mode 100644 index 00000000000..7f92c3c2170 --- /dev/null +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDao.java @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.netapp.dao; + +import java.util.List; + +import com.cloud.netapp.NetappVolumeVO; +import com.cloud.utils.db.GenericDao; + +public interface VolumeDao extends GenericDao { + + NetappVolumeVO findVolume(String ipAddress, String aggregateName, String volumeName); + List listVolumes(String poolName); + NetappVolumeVO returnRoundRobinMarkerInPool(String poolName,int roundRobinMarker); + List listVolumesAscending(String poolName); +} diff --git a/server/src/com/cloud/netapp/dao/VolumeDaoImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java similarity index 81% rename from server/src/com/cloud/netapp/dao/VolumeDaoImpl.java rename to plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java index a540b84bc90..9c23410eb0f 100644 --- a/server/src/com/cloud/netapp/dao/VolumeDaoImpl.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/dao/VolumeDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.netapp.dao; import java.util.List; diff --git a/plugins/host-allocators/random/.classpath b/plugins/host-allocators/random/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/host-allocators/random/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/host-allocators/random/.project b/plugins/host-allocators/random/.project new file mode 100755 index 00000000000..d33268dd646 --- /dev/null +++ b/plugins/host-allocators/random/.project @@ -0,0 +1,17 @@ + + + random-host-allocator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/host-allocators/random/build.xml b/plugins/host-allocators/random/build.xml new file mode 100755 index 00000000000..6cb8fd8980e --- /dev/null +++ b/plugins/host-allocators/random/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java similarity index 100% rename from server/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java rename to plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java diff --git a/ovm/.classpath b/plugins/hypervisors/ovm/.classpath old mode 100644 new mode 100755 similarity index 100% rename from ovm/.classpath rename to plugins/hypervisors/ovm/.classpath diff --git a/ovm/.project b/plugins/hypervisors/ovm/.project similarity index 95% rename from ovm/.project rename to plugins/hypervisors/ovm/.project index 4b9d34562c4..6ef55a50063 100755 --- a/ovm/.project +++ b/plugins/hypervisors/ovm/.project @@ -1,23 +1,23 @@ - - - ovm - - - - - - org.python.pydev.PyDevBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - org.python.pydev.pythonNature - - + + + ovm + + + + + + org.python.pydev.PyDevBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + org.python.pydev.pythonNature + + diff --git a/plugins/hypervisors/ovm/build.xml b/plugins/hypervisors/ovm/build.xml new file mode 100755 index 00000000000..8113d725daa --- /dev/null +++ b/plugins/hypervisors/ovm/build.xml @@ -0,0 +1,136 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ovm/scripts/vm/hypervisor/ovm/ConfigFileOps.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/ConfigFileOps.py old mode 100644 new mode 100755 similarity index 87% rename from ovm/scripts/vm/hypervisor/ovm/ConfigFileOps.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/ConfigFileOps.py index c8bffe2bdba..62d09fcd62e --- a/ovm/scripts/vm/hypervisor/ovm/ConfigFileOps.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/ConfigFileOps.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. import re class ConfigFileOps: class entry: diff --git a/ovm/scripts/vm/hypervisor/ovm/Fixget_storage_reposExceptionDueToWrongReturnValueCheck.patch b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/Fixget_storage_reposExceptionDueToWrongReturnValueCheck.patch old mode 100644 new mode 100755 similarity index 100% rename from ovm/scripts/vm/hypervisor/ovm/Fixget_storage_reposExceptionDueToWrongReturnValueCheck.patch rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/Fixget_storage_reposExceptionDueToWrongReturnValueCheck.patch diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmCommonModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmCommonModule.py similarity index 84% rename from ovm/scripts/vm/hypervisor/ovm/OvmCommonModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmCommonModule.py index aae6f714cf3..558e58a2dad 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmCommonModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmCommonModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on May 17, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmDiskModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDiskModule.py old mode 100644 new mode 100755 similarity index 61% rename from ovm/scripts/vm/hypervisor/ovm/OvmDiskModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDiskModule.py index 7ae6c725ed0..b3214ec9b1f --- a/ovm/scripts/vm/hypervisor/ovm/OvmDiskModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDiskModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on May 17, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmDispatcher.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDispatcher.py old mode 100644 new mode 100755 similarity index 70% rename from ovm/scripts/vm/hypervisor/ovm/OvmDispatcher.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDispatcher.py index 8db558ed107..78d1faeaba2 --- a/ovm/scripts/vm/hypervisor/ovm/OvmDispatcher.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDispatcher.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. import types from OvmCommonModule import * from xmlrpclib import Fault diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmDontTouchOCFS2ClusterWhenAgentStart.patch b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDontTouchOCFS2ClusterWhenAgentStart.patch old mode 100644 new mode 100755 similarity index 100% rename from ovm/scripts/vm/hypervisor/ovm/OvmDontTouchOCFS2ClusterWhenAgentStart.patch rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmDontTouchOCFS2ClusterWhenAgentStart.patch diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmFaultConstants.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmFaultConstants.py similarity index 80% rename from ovm/scripts/vm/hypervisor/ovm/OvmFaultConstants.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmFaultConstants.py index 9c3c7b9992b..d929d814da5 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmFaultConstants.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmFaultConstants.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. OvmDispatcherStub = 0 OvmHostErrCodeStub = 1000 OvmVmErrCodeStub = 2000 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmHaHeartBeatModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHaHeartBeatModule.py old mode 100644 new mode 100755 similarity index 77% rename from ovm/scripts/vm/hypervisor/ovm/OvmHaHeartBeatModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHaHeartBeatModule.py index eeee35ac8ca..02ad816f069 --- a/ovm/scripts/vm/hypervisor/ovm/OvmHaHeartBeatModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHaHeartBeatModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on Jun 6, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py similarity index 94% rename from ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py index 9cfbd469879..3c61500630d 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py @@ -1,16 +1,19 @@ -#/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. from OvmCommonModule import * from OVSSiteRMServer import get_master_ip, register_server diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmLoggerModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmLoggerModule.py old mode 100644 new mode 100755 similarity index 56% rename from ovm/scripts/vm/hypervisor/ovm/OvmLoggerModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmLoggerModule.py index 07fe78f5d85..94f3a81aa4a --- a/ovm/scripts/vm/hypervisor/ovm/OvmLoggerModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmLoggerModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on May 19, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmNetworkModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmNetworkModule.py similarity index 94% rename from ovm/scripts/vm/hypervisor/ovm/OvmNetworkModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmNetworkModule.py index 5813fcd489a..c60b1ecbd36 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmNetworkModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmNetworkModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. from OvmCommonModule import * import traceback import time diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmOCFS2Module.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmOCFS2Module.py similarity index 71% rename from ovm/scripts/vm/hypervisor/ovm/OvmOCFS2Module.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmOCFS2Module.py index 9a8f0eba1ac..bf330f22885 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmOCFS2Module.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmOCFS2Module.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. from OvmCommonModule import * logger = OvmLogger('OvmOCFS2') diff --git a/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmObjectModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmObjectModule.py new file mode 100755 index 00000000000..d5d652cb9cf --- /dev/null +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmObjectModule.py @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +''' +Created on May 17, 2011 + +@author: frank +''' + +class OvmObject(object): + pass \ No newline at end of file diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmPatch.patch b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmPatch.patch old mode 100644 new mode 100755 similarity index 100% rename from ovm/scripts/vm/hypervisor/ovm/OvmPatch.patch rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmPatch.patch diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmSecurityGroupModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmSecurityGroupModule.py old mode 100644 new mode 100755 similarity index 95% rename from ovm/scripts/vm/hypervisor/ovm/OvmSecurityGroupModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmSecurityGroupModule.py index 98163149b2b..d04d1044ac2 --- a/ovm/scripts/vm/hypervisor/ovm/OvmSecurityGroupModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmSecurityGroupModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. from OvmCommonModule import * from ConfigFileOps import * import os diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmStoragePoolModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmStoragePoolModule.py similarity index 95% rename from ovm/scripts/vm/hypervisor/ovm/OvmStoragePoolModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmStoragePoolModule.py index 9d83037d781..f4933eccaa9 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmStoragePoolModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmStoragePoolModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. from OvmCommonModule import * from OVSSiteSR import sp_create, sr_create, sr_do from OVSParser import parse_ocfs2_cluster_conf diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmVifModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVifModule.py old mode 100644 new mode 100755 similarity index 60% rename from ovm/scripts/vm/hypervisor/ovm/OvmVifModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVifModule.py index 3405c5ae59f..66c703aff66 --- a/ovm/scripts/vm/hypervisor/ovm/OvmVifModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVifModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on May 17, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py similarity index 96% rename from ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py index 12c32064eda..fc223d6e391 100755 --- a/ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on May 17, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/OvmVolumeModule.py b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVolumeModule.py old mode 100644 new mode 100755 similarity index 86% rename from ovm/scripts/vm/hypervisor/ovm/OvmVolumeModule.py rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVolumeModule.py index 8daa846549a..583d460e798 --- a/ovm/scripts/vm/hypervisor/ovm/OvmVolumeModule.py +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVolumeModule.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ''' Created on June 2, 2011 diff --git a/ovm/scripts/vm/hypervisor/ovm/configureOvm.sh b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/configureOvm.sh similarity index 80% rename from ovm/scripts/vm/hypervisor/ovm/configureOvm.sh rename to plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/configureOvm.sh index 1fffd5a8a57..4ed8aa9d1bf 100755 --- a/ovm/scripts/vm/hypervisor/ovm/configureOvm.sh +++ b/plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/configureOvm.sh @@ -1,16 +1,20 @@ #!/bin/sh -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. errExit() { echo $@ diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java similarity index 91% rename from ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java index 3523562b779..cd15d8fbd63 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.hypervisor; import java.net.InetAddress; diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java similarity index 77% rename from ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java index fe336773559..cceb7fe969b 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.hypervisor; import java.util.List; diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java similarity index 59% rename from ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java index b24be714e9c..20221c3d335 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.hypervisor; import javax.ejb.Local; diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmHelper.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmHelper.java similarity index 74% rename from ovm/src/com/cloud/ovm/hypervisor/OvmHelper.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmHelper.java index 63300583f92..f92fc784b16 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmHelper.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmHelper.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.hypervisor; import java.util.HashMap; diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java similarity index 98% rename from ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java index 8232112ab5a..c48b13f66bb 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.hypervisor; import java.io.File; diff --git a/ovm/src/com/cloud/ovm/object/Coder.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Coder.java old mode 100644 new mode 100755 similarity index 72% rename from ovm/src/com/cloud/ovm/object/Coder.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/Coder.java index ceced51c208..da4aa4dce1a --- a/ovm/src/com/cloud/ovm/object/Coder.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Coder.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.lang.reflect.Type; diff --git a/ovm/src/com/cloud/ovm/object/Connection.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Connection.java similarity index 81% rename from ovm/src/com/cloud/ovm/object/Connection.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/Connection.java index 9d0c906945b..3a107c27d0c 100755 --- a/ovm/src/com/cloud/ovm/object/Connection.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Connection.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.net.MalformedURLException; diff --git a/ovm/src/com/cloud/ovm/object/OvmBridge.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmBridge.java old mode 100644 new mode 100755 similarity index 68% rename from ovm/src/com/cloud/ovm/object/OvmBridge.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmBridge.java index 31986ff315d..49d09f46238 --- a/ovm/src/com/cloud/ovm/object/OvmBridge.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmBridge.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.util.List; diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmDisk.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmDisk.java new file mode 100755 index 00000000000..cb90b7a3fa3 --- /dev/null +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmDisk.java @@ -0,0 +1,31 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.ovm.object; + + +public class OvmDisk extends OvmObject { + public static final String WRITE = "w"; + public static final String READ = "r"; + public static final String SHAREDWRITE = "w!"; + public static final String SHAREDREAD = "r!"; + + public static class Details { + public String type; + public String path; + public Boolean isIso; + } +} diff --git a/ovm/src/com/cloud/ovm/object/OvmHost.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmHost.java similarity index 75% rename from ovm/src/com/cloud/ovm/object/OvmHost.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmHost.java index abbe539eddc..9b293909cee 100755 --- a/ovm/src/com/cloud/ovm/object/OvmHost.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmHost.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.util.List; diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmObject.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmObject.java new file mode 100755 index 00000000000..eeea491c9f6 --- /dev/null +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmObject.java @@ -0,0 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.ovm.object; + +public class OvmObject { +} diff --git a/ovm/src/com/cloud/ovm/object/OvmSecurityGroup.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmSecurityGroup.java old mode 100644 new mode 100755 similarity index 67% rename from ovm/src/com/cloud/ovm/object/OvmSecurityGroup.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmSecurityGroup.java index 33bb133057c..8a318498cd0 --- a/ovm/src/com/cloud/ovm/object/OvmSecurityGroup.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmSecurityGroup.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import org.apache.xmlrpc.XmlRpcException; diff --git a/ovm/src/com/cloud/ovm/object/OvmStoragePool.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmStoragePool.java similarity index 79% rename from ovm/src/com/cloud/ovm/object/OvmStoragePool.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmStoragePool.java index 30246b89bdc..d182b0ca362 100755 --- a/ovm/src/com/cloud/ovm/object/OvmStoragePool.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmStoragePool.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.util.Map; diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVif.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVif.java new file mode 100755 index 00000000000..8a3bd7fd4fc --- /dev/null +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVif.java @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.ovm.object; + +public class OvmVif extends OvmObject { + public static final String NETFRONT = "netfront"; + public static final String IOEMU = "ioemu"; + + public static class Details { + public String name; + public String mac; + public String bridge; + public String type; + } + +} diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVlan.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVlan.java new file mode 100755 index 00000000000..947545c4596 --- /dev/null +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVlan.java @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.ovm.object; + +import org.apache.xmlrpc.XmlRpcException; + +public class OvmVlan extends OvmObject { + public static class Details { + public String name; + public int vid; + public String pif; + + public String toJson() { + return Coder.toJson(this); + } + } + + public static String create(Connection c, Details d) throws XmlRpcException { + Object[] params = {d.toJson()}; + String res = (String)c.call("OvmNetwork.createVlan", params); + Details ret = Coder.fromJson(res, Details.class); + return ret.name; + } + + public static void delete(Connection c, String name) throws XmlRpcException { + Object[] params = {name}; + c.call("OvmNetwork.deleteVlan", params); + } +} diff --git a/ovm/src/com/cloud/ovm/object/OvmVm.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVm.java old mode 100644 new mode 100755 similarity index 79% rename from ovm/src/com/cloud/ovm/object/OvmVm.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVm.java index 2b538331292..24a8f4abb0e --- a/ovm/src/com/cloud/ovm/object/OvmVm.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVm.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.util.ArrayList; diff --git a/ovm/src/com/cloud/ovm/object/OvmVolume.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVolume.java old mode 100644 new mode 100755 similarity index 59% rename from ovm/src/com/cloud/ovm/object/OvmVolume.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVolume.java index a64c963e1d2..c25eb3f7fe8 --- a/ovm/src/com/cloud/ovm/object/OvmVolume.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/OvmVolume.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import org.apache.xmlrpc.XmlRpcException; diff --git a/ovm/src/com/cloud/ovm/object/Test.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Test.java old mode 100644 new mode 100755 similarity index 89% rename from ovm/src/com/cloud/ovm/object/Test.java rename to plugins/hypervisors/ovm/src/com/cloud/ovm/object/Test.java index 9d56f7d99f2..2efbbbe915a --- a/ovm/src/com/cloud/ovm/object/Test.java +++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/object/Test.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.ovm.object; import java.net.URL; diff --git a/plugins/hypervisors/vmware/.classpath b/plugins/hypervisors/vmware/.classpath new file mode 100755 index 00000000000..74eb425c5d7 --- /dev/null +++ b/plugins/hypervisors/vmware/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/plugins/hypervisors/vmware/.project b/plugins/hypervisors/vmware/.project new file mode 100755 index 00000000000..f53a2a299a5 --- /dev/null +++ b/plugins/hypervisors/vmware/.project @@ -0,0 +1,23 @@ + + + vmware + + + + + + org.python.pydev.PyDevBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + org.python.pydev.pythonNature + + diff --git a/plugins/hypervisors/vmware/build.xml b/plugins/hypervisors/vmware/build.xml new file mode 100755 index 00000000000..f6bcd435ae4 --- /dev/null +++ b/plugins/hypervisors/vmware/build.xml @@ -0,0 +1,135 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java diff --git a/server/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java diff --git a/server/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java diff --git a/server/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java diff --git a/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java b/plugins/hypervisors/vmware/src/com/cloud/api/response/CiscoNexusVSMResponse.java similarity index 100% rename from api/src/com/cloud/api/response/CiscoNexusVSMResponse.java rename to plugins/hypervisors/vmware/src/com/cloud/api/response/CiscoNexusVSMResponse.java diff --git a/server/src/com/cloud/ha/VmwareFencer.java b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java similarity index 100% rename from server/src/com/cloud/ha/VmwareFencer.java rename to plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java diff --git a/server/src/com/cloud/ha/VmwareInvestigator.java b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java similarity index 100% rename from server/src/com/cloud/ha/VmwareInvestigator.java rename to plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java diff --git a/server/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java similarity index 100% rename from server/src/com/cloud/hypervisor/guru/VMwareGuru.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java similarity index 100% rename from server/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java similarity index 98% rename from server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java index 65a10688608..af53daded02 100755 --- a/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -10,8 +10,8 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.hypervisor.vmware; - +package com.cloud.hypervisor.vmware; + import java.net.URI; import java.net.URLDecoder; import java.util.HashMap; @@ -64,42 +64,42 @@ import com.cloud.utils.component.ComponentLocator; import com.cloud.utils.component.Inject; import com.vmware.vim25.ClusterDasConfigInfo; import com.vmware.vim25.ManagedObjectReference; - -@Local(value=Discoverer.class) -public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { - private static final Logger s_logger = Logger.getLogger(VmwareServerDiscoverer.class); - - @Inject ClusterDao _clusterDao; - @Inject VmwareManager _vmwareMgr; - @Inject AlertManager _alertMgr; - @Inject VMTemplateDao _tmpltDao; + +@Local(value=Discoverer.class) +public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { + private static final Logger s_logger = Logger.getLogger(VmwareServerDiscoverer.class); + + @Inject ClusterDao _clusterDao; + @Inject VmwareManager _vmwareMgr; + @Inject AlertManager _alertMgr; + @Inject VMTemplateDao _tmpltDao; @Inject ClusterDetailsDao _clusterDetailsDao; @Inject HostDao _hostDao; @Inject - DataCenterDao _dcDao; + DataCenterDao _dcDao; @Inject ResourceManager _resourceMgr; @Inject CiscoNexusVSMDeviceDao _nexusDao; @Inject NetworkManager _netmgr; - - @Override - public Map> find(long dcId, Long podId, Long clusterId, URI url, - String username, String password, List hostTags) throws DiscoveryException { - - if(s_logger.isInfoEnabled()) - s_logger.info("Discover host. dc: " + dcId + ", pod: " + podId + ", cluster: " + clusterId + ", uri host: " + url.getHost()); - - if(podId == null) { - if(s_logger.isInfoEnabled()) - s_logger.info("No pod is assigned, assuming that it is not for vmware and skip it to next discoverer"); - return null; - } - - ClusterVO cluster = _clusterDao.findById(clusterId); - if(cluster == null || cluster.getHypervisorType() != HypervisorType.VMware) { - if(s_logger.isInfoEnabled()) - s_logger.info("invalid cluster id or cluster is not for VMware hypervisors"); - return null; + + @Override + public Map> find(long dcId, Long podId, Long clusterId, URI url, + String username, String password, List hostTags) throws DiscoveryException { + + if(s_logger.isInfoEnabled()) + s_logger.info("Discover host. dc: " + dcId + ", pod: " + podId + ", cluster: " + clusterId + ", uri host: " + url.getHost()); + + if(podId == null) { + if(s_logger.isInfoEnabled()) + s_logger.info("No pod is assigned, assuming that it is not for vmware and skip it to next discoverer"); + return null; + } + + ClusterVO cluster = _clusterDao.findById(clusterId); + if(cluster == null || cluster.getHypervisorType() != HypervisorType.VMware) { + if(s_logger.isInfoEnabled()) + s_logger.info("invalid cluster id or cluster is not for VMware hypervisors"); + return null; } List hosts = _resourceMgr.listAllHostsInCluster(clusterId); @@ -135,9 +135,9 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer } vsmCredentials = _vmwareMgr.getNexusVSMCredentialsByClusterId(clusterId); } - - VmwareContext context = null; - try { + + VmwareContext context = null; + try { context = VmwareContextFactory.create(url.getHost(), username, password); if (privateTrafficLabel != null) context.registerStockObject("privateTrafficLabel", privateTrafficLabel); @@ -147,64 +147,64 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer s_logger.info("Stocking credentials of Nexus VSM"); context.registerStockObject("vsmcredentials", vsmCredentials); } - } - List morHosts = _vmwareMgr.addHostToPodCluster(context, dcId, podId, clusterId, + } + List morHosts = _vmwareMgr.addHostToPodCluster(context, dcId, podId, clusterId, URLDecoder.decode(url.getPath())); if (morHosts == null) s_logger.info("Found 0 hosts."); if (privateTrafficLabel != null) context.uregisterStockObject("privateTrafficLabel"); - - if(morHosts == null) { - s_logger.error("Unable to find host or cluster based on url: " + URLDecoder.decode(url.getPath())); - return null; - } - - ManagedObjectReference morCluster = null; - Map clusterDetails = _clusterDetailsDao.findDetails(clusterId); - if(clusterDetails.get("url") != null) { - URI uriFromCluster = new URI(UriUtils.encodeURIComponent(clusterDetails.get("url"))); - morCluster = context.getHostMorByPath(URLDecoder.decode(uriFromCluster.getPath())); - - if(morCluster == null || !morCluster.getType().equalsIgnoreCase("ClusterComputeResource")) { - s_logger.warn("Cluster url does not point to a valid vSphere cluster, url: " + clusterDetails.get("url")); - return null; - } else { - ClusterMO clusterMo = new ClusterMO(context, morCluster); - ClusterDasConfigInfo dasConfig = clusterMo.getDasConfig(); - if(dasConfig != null && dasConfig.getEnabled() != null && dasConfig.getEnabled().booleanValue()) { - clusterDetails.put("NativeHA", "true"); - _clusterDetailsDao.persist(clusterId, clusterDetails); - } - } - } - - if(!validateDiscoveredHosts(context, morCluster, morHosts)) { - if(morCluster == null) - s_logger.warn("The discovered host is not standalone host, can not be added to a standalone cluster"); - else - s_logger.warn("The discovered host does not belong to the cluster"); - return null; - } - - Map> resources = new HashMap>(); - for(ManagedObjectReference morHost : morHosts) { - Map details = new HashMap(); - Map params = new HashMap(); - - HostMO hostMo = new HostMO(context, morHost); - details.put("url", hostMo.getHostName()); - details.put("username", username); - details.put("password", password); - String guid = morHost.getType() + ":" + morHost.get_value() + "@"+ url.getHost(); - details.put("guid", guid); - - params.put("url", hostMo.getHostName()); - params.put("username", username); - params.put("password", password); - params.put("zone", Long.toString(dcId)); - params.put("pod", Long.toString(podId)); - params.put("cluster", Long.toString(clusterId)); + + if(morHosts == null) { + s_logger.error("Unable to find host or cluster based on url: " + URLDecoder.decode(url.getPath())); + return null; + } + + ManagedObjectReference morCluster = null; + Map clusterDetails = _clusterDetailsDao.findDetails(clusterId); + if(clusterDetails.get("url") != null) { + URI uriFromCluster = new URI(UriUtils.encodeURIComponent(clusterDetails.get("url"))); + morCluster = context.getHostMorByPath(URLDecoder.decode(uriFromCluster.getPath())); + + if(morCluster == null || !morCluster.getType().equalsIgnoreCase("ClusterComputeResource")) { + s_logger.warn("Cluster url does not point to a valid vSphere cluster, url: " + clusterDetails.get("url")); + return null; + } else { + ClusterMO clusterMo = new ClusterMO(context, morCluster); + ClusterDasConfigInfo dasConfig = clusterMo.getDasConfig(); + if(dasConfig != null && dasConfig.getEnabled() != null && dasConfig.getEnabled().booleanValue()) { + clusterDetails.put("NativeHA", "true"); + _clusterDetailsDao.persist(clusterId, clusterDetails); + } + } + } + + if(!validateDiscoveredHosts(context, morCluster, morHosts)) { + if(morCluster == null) + s_logger.warn("The discovered host is not standalone host, can not be added to a standalone cluster"); + else + s_logger.warn("The discovered host does not belong to the cluster"); + return null; + } + + Map> resources = new HashMap>(); + for(ManagedObjectReference morHost : morHosts) { + Map details = new HashMap(); + Map params = new HashMap(); + + HostMO hostMo = new HostMO(context, morHost); + details.put("url", hostMo.getHostName()); + details.put("username", username); + details.put("password", password); + String guid = morHost.getType() + ":" + morHost.get_value() + "@"+ url.getHost(); + details.put("guid", guid); + + params.put("url", hostMo.getHostName()); + params.put("username", username); + params.put("password", password); + params.put("zone", Long.toString(dcId)); + params.put("pod", Long.toString(podId)); + params.put("cluster", Long.toString(clusterId)); params.put("guid", guid); if (privateTrafficLabel != null) { params.put("private.network.vswitch.name", privateTrafficLabel); @@ -214,113 +214,113 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer } if (guestTrafficLabel != null) { params.put("guest.network.vswitch.name", guestTrafficLabel); - } - - VmwareResource resource = new VmwareResource(); - try { - resource.configure("VMware", params); - } catch (ConfigurationException e) { - _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, "Unable to add " + url.getHost(), "Error is " + e.getMessage()); - s_logger.warn("Unable to instantiate " + url.getHost(), e); - } - resource.start(); - - resources.put(resource, details); - } - - // place a place holder guid derived from cluster ID - cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString()); - _clusterDao.update(clusterId, cluster); - - return resources; + } + + VmwareResource resource = new VmwareResource(); + try { + resource.configure("VMware", params); + } catch (ConfigurationException e) { + _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, "Unable to add " + url.getHost(), "Error is " + e.getMessage()); + s_logger.warn("Unable to instantiate " + url.getHost(), e); + } + resource.start(); + + resources.put(resource, details); + } + + // place a place holder guid derived from cluster ID + cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString()); + _clusterDao.update(clusterId, cluster); + + return resources; } catch (DiscoveredWithErrorException e) { throw e; - } catch (Exception e) { - s_logger.warn("Unable to connect to Vmware vSphere server. service address: " + url.getHost()); - return null; - } finally { - if(context != null) - context.close(); - } - } - - private boolean validateDiscoveredHosts(VmwareContext context, ManagedObjectReference morCluster, List morHosts) throws Exception { - if(morCluster == null) { - for(ManagedObjectReference morHost : morHosts) { - ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); - if(morParent.getType().equalsIgnoreCase("ClusterComputeResource")) - return false; - } - } else { - for(ManagedObjectReference morHost : morHosts) { - ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); - if(!morParent.getType().equalsIgnoreCase("ClusterComputeResource")) - return false; - - if(!morParent.get_value().equals(morCluster.get_value())) - return false; - } - } - - return true; - } - - @Override - public void postDiscovery(List hosts, long msId) { - // do nothing - } - - @Override - public boolean matchHypervisor(String hypervisor) { - if(hypervisor == null) - return true; - - return Hypervisor.HypervisorType.VMware.toString().equalsIgnoreCase(hypervisor); - } - - @Override - public Hypervisor.HypervisorType getHypervisorType() { - return Hypervisor.HypervisorType.VMware; - } - - @Override - public boolean configure(String name, Map params) throws ConfigurationException { - if(s_logger.isInfoEnabled()) - s_logger.info("Configure VmwareServerDiscoverer, discover name: " + name); - - super.configure(name, params); - - ComponentLocator locator = ComponentLocator.getCurrentLocator(); - ConfigurationDao configDao = locator.getDao(ConfigurationDao.class); - if (configDao == null) { - throw new ConfigurationException("Unable to get the configuration dao."); - } - - createVmwareToolsIso(); - - if(s_logger.isInfoEnabled()) { + } catch (Exception e) { + s_logger.warn("Unable to connect to Vmware vSphere server. service address: " + url.getHost()); + return null; + } finally { + if(context != null) + context.close(); + } + } + + private boolean validateDiscoveredHosts(VmwareContext context, ManagedObjectReference morCluster, List morHosts) throws Exception { + if(morCluster == null) { + for(ManagedObjectReference morHost : morHosts) { + ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); + if(morParent.getType().equalsIgnoreCase("ClusterComputeResource")) + return false; + } + } else { + for(ManagedObjectReference morHost : morHosts) { + ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); + if(!morParent.getType().equalsIgnoreCase("ClusterComputeResource")) + return false; + + if(!morParent.get_value().equals(morCluster.get_value())) + return false; + } + } + + return true; + } + + @Override + public void postDiscovery(List hosts, long msId) { + // do nothing + } + + @Override + public boolean matchHypervisor(String hypervisor) { + if(hypervisor == null) + return true; + + return Hypervisor.HypervisorType.VMware.toString().equalsIgnoreCase(hypervisor); + } + + @Override + public Hypervisor.HypervisorType getHypervisorType() { + return Hypervisor.HypervisorType.VMware; + } + + @Override + public boolean configure(String name, Map params) throws ConfigurationException { + if(s_logger.isInfoEnabled()) + s_logger.info("Configure VmwareServerDiscoverer, discover name: " + name); + + super.configure(name, params); + + ComponentLocator locator = ComponentLocator.getCurrentLocator(); + ConfigurationDao configDao = locator.getDao(ConfigurationDao.class); + if (configDao == null) { + throw new ConfigurationException("Unable to get the configuration dao."); + } + + createVmwareToolsIso(); + + if(s_logger.isInfoEnabled()) { s_logger.info("VmwareServerDiscoverer has been successfully configured"); } - _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); - return true; - } - - private void createVmwareToolsIso() { - String isoName = "vmware-tools.iso"; - VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName); - Long id; - if (tmplt == null) { - id = _tmpltDao.getNextInSequence(Long.class, "id"); - VMTemplateVO template = new VMTemplateVO(id, isoName, isoName, ImageFormat.ISO, true, true, - TemplateType.PERHOST, null, null, true, 64, - Account.ACCOUNT_ID_SYSTEM, null, "VMware Tools Installer ISO", false, 1, false, HypervisorType.VMware); - _tmpltDao.persist(template); - } else { - id = tmplt.getId(); - tmplt.setTemplateType(TemplateType.PERHOST); - tmplt.setUrl(null); - _tmpltDao.update(id, tmplt); - } + _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); + return true; + } + + private void createVmwareToolsIso() { + String isoName = "vmware-tools.iso"; + VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName); + Long id; + if (tmplt == null) { + id = _tmpltDao.getNextInSequence(Long.class, "id"); + VMTemplateVO template = new VMTemplateVO(id, isoName, isoName, ImageFormat.ISO, true, true, + TemplateType.PERHOST, null, null, true, 64, + Account.ACCOUNT_ID_SYSTEM, null, "VMware Tools Installer ISO", false, 1, false, HypervisorType.VMware); + _tmpltDao.persist(template); + } else { + id = tmplt.getId(); + tmplt.setTemplateType(TemplateType.PERHOST); + tmplt.setUrl(null); + _tmpltDao.update(id, tmplt); + } } @Override @@ -359,6 +359,6 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer public boolean stop() { _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName()); return super.stop(); - } -} - + } +} + diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java similarity index 99% rename from server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 90a040b2eb1..debb6fe38b2 100755 --- a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -10,7 +10,7 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.hypervisor.vmware; +package com.cloud.hypervisor.vmware.manager; import java.io.File; import java.io.IOException; @@ -54,6 +54,7 @@ import com.cloud.host.HostVO; import com.cloud.host.Status; import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.hypervisor.vmware.VmwareCleanupMaid; import com.cloud.hypervisor.vmware.manager.VmwareManager; import com.cloud.hypervisor.vmware.manager.VmwareStorageManager; import com.cloud.hypervisor.vmware.manager.VmwareStorageManagerImpl; @@ -65,7 +66,7 @@ import com.cloud.hypervisor.vmware.mo.HypervisorHostHelper; import com.cloud.hypervisor.vmware.mo.TaskMO; import com.cloud.hypervisor.vmware.mo.VirtualEthernetCardType; import com.cloud.hypervisor.vmware.mo.VmwareHostType; -import com.cloud.hypervisor.vmware.resource.SshHelper; +import com.cloud.utils.ssh.SshHelper; import com.cloud.hypervisor.vmware.util.VmwareContext; import com.cloud.network.CiscoNexusVSMDeviceVO; import com.cloud.network.NetworkManager; diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java similarity index 99% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java index afd13d106b3..b525e13654a 100644 --- a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java @@ -123,11 +123,11 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { DatacenterMO dcMo = new DatacenterMO(context, hyperHost.getHyperHostDatacenter()); VirtualMachineMO templateMo = VmwareHelper.pickOneVmOnRunningHost(dcMo.findVmByNameAndLabel(templateUuidName), true); - - if (templateMo == null) { - if(s_logger.isInfoEnabled()) - s_logger.info("Template " + templateName + " is not setup yet, setup template from secondary storage with uuid name: " + templateUuidName); - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); + + if (templateMo == null) { + if(s_logger.isInfoEnabled()) + s_logger.info("Template " + templateName + " is not setup yet, setup template from secondary storage with uuid name: " + templateUuidName); + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); assert (morDs != null); DatastoreMO primaryStorageDatastoreMo = new DatastoreMO(context, morDs); @@ -171,8 +171,8 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { VmwareContext context = hostService.getServiceContext(cmd); VirtualMachineMO vmMo = null; - try { - VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); + try { + VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPool().getUuid()); try { @@ -202,7 +202,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { // attach volume to worker VM String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), volumePath); vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs); - } + } } if (!vmMo.createSnapshot(snapshotUuid, "Snapshot taken for " + cmd.getSnapshotName(), false, false)) { @@ -340,79 +340,79 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { hyperHost, cmd, vmName, volumeId, cmd.getPool().getUuid(), volumePath, secondaryStorageURL, hostService.getWorkerName(context, cmd, 0)); - } else { - StorageFilerTO poolTO = cmd.getPool(); - - ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, poolTO.getUuid()); - if (morDatastore == null) { - morDatastore = hyperHost.mountDatastore( - false, - poolTO.getHost(), 0, poolTO.getPath(), - poolTO.getUuid().replace("-", "")); - - if (morDatastore == null) { - throw new Exception("Unable to mount storage pool on host. storeUrl: " + poolTO.getHost() + ":/" + poolTO.getPath()); - } - } - - result = copyVolumeFromSecStorage( - hyperHost, volumeId, - new DatastoreMO(context, morDatastore), - secondaryStorageURL, volumePath); - } - return new CopyVolumeAnswer(cmd, true, null, result.first(), result.second()); - } catch (Throwable e) { - if (e instanceof RemoteException) { - hostService.invalidateServiceContext(context); - } + } else { + StorageFilerTO poolTO = cmd.getPool(); - String msg = "Unable to execute CopyVolumeCommand due to exception"; - s_logger.error(msg, e); - return new CopyVolumeAnswer(cmd, false, "CopyVolumeCommand failed due to exception: " + StringUtils.getExceptionStackInfo(e), null, null); - } - } - - @Override - public Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd) { - - String primaryStorageNameLabel = cmd.getPrimaryStoragePoolNameLabel(); - Long accountId = cmd.getAccountId(); - Long volumeId = cmd.getVolumeId(); - String secondaryStorageUrl = cmd.getSecondaryStorageUrl(); - String backedUpSnapshotUuid = cmd.getSnapshotUuid(); - - String details = null; - boolean success = false; - String newVolumeName = UUID.randomUUID().toString().replaceAll("-", ""); - - VmwareContext context = hostService.getServiceContext(cmd); - try { - VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); - - ManagedObjectReference morPrimaryDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, primaryStorageNameLabel); - if (morPrimaryDs == null) { - String msg = "Unable to find datastore: " + primaryStorageNameLabel; - s_logger.error(msg); - throw new Exception(msg); - } - - DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs); - details = createVolumeFromSnapshot(hyperHost, primaryDsMo, - newVolumeName, accountId, volumeId, secondaryStorageUrl, backedUpSnapshotUuid); - if (details == null) { - success = true; - } - } catch (Throwable e) { - if (e instanceof RemoteException) { - hostService.invalidateServiceContext(context); - } - - s_logger.error("Unexpecpted exception ", e); - details = "CreateVolumeFromSnapshotCommand exception: " + StringUtils.getExceptionStackInfo(e); - } - - return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); - } + ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, poolTO.getUuid()); + if (morDatastore == null) { + morDatastore = hyperHost.mountDatastore( + false, + poolTO.getHost(), 0, poolTO.getPath(), + poolTO.getUuid().replace("-", "")); + + if (morDatastore == null) { + throw new Exception("Unable to mount storage pool on host. storeUrl: " + poolTO.getHost() + ":/" + poolTO.getPath()); + } + } + + result = copyVolumeFromSecStorage( + hyperHost, volumeId, + new DatastoreMO(context, morDatastore), + secondaryStorageURL, volumePath); + } + return new CopyVolumeAnswer(cmd, true, null, result.first(), result.second()); + } catch (Throwable e) { + if (e instanceof RemoteException) { + hostService.invalidateServiceContext(context); + } + + String msg = "Unable to execute CopyVolumeCommand due to exception"; + s_logger.error(msg, e); + return new CopyVolumeAnswer(cmd, false, "CopyVolumeCommand failed due to exception: " + StringUtils.getExceptionStackInfo(e), null, null); + } + } + + @Override + public Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd) { + + String primaryStorageNameLabel = cmd.getPrimaryStoragePoolNameLabel(); + Long accountId = cmd.getAccountId(); + Long volumeId = cmd.getVolumeId(); + String secondaryStorageUrl = cmd.getSecondaryStorageUrl(); + String backedUpSnapshotUuid = cmd.getSnapshotUuid(); + + String details = null; + boolean success = false; + String newVolumeName = UUID.randomUUID().toString().replaceAll("-", ""); + + VmwareContext context = hostService.getServiceContext(cmd); + try { + VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); + + ManagedObjectReference morPrimaryDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, primaryStorageNameLabel); + if (morPrimaryDs == null) { + String msg = "Unable to find datastore: " + primaryStorageNameLabel; + s_logger.error(msg); + throw new Exception(msg); + } + + DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs); + details = createVolumeFromSnapshot(hyperHost, primaryDsMo, + newVolumeName, accountId, volumeId, secondaryStorageUrl, backedUpSnapshotUuid); + if (details == null) { + success = true; + } + } catch (Throwable e) { + if (e instanceof RemoteException) { + hostService.invalidateServiceContext(context); + } + + s_logger.error("Unexpecpted exception ", e); + details = "CreateVolumeFromSnapshotCommand exception: " + StringUtils.getExceptionStackInfo(e); + } + + return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); + } // templateName: name in secondary storage // templateUuid: will be used at hypervisor layer diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java diff --git a/core/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java diff --git a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java similarity index 99% rename from core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index f4771b8fc2a..a8c61f6fad8 100755 --- a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -188,6 +188,7 @@ import com.cloud.utils.exception.ExceptionUtil; import com.cloud.utils.mgmt.JmxUtil; import com.cloud.utils.mgmt.PropertyMapDynamicBean; import com.cloud.utils.net.NetUtils; +import com.cloud.utils.ssh.SshHelper; import com.cloud.vm.DiskProfile; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.State; @@ -230,12 +231,12 @@ import com.vmware.vim25.VirtualMachineGuestOsIdentifier; import com.vmware.vim25.VirtualMachinePowerState; import com.vmware.vim25.VirtualMachineRuntimeInfo; import com.vmware.vim25.VirtualSCSISharing; - -public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService { - private static final Logger s_logger = Logger.getLogger(VmwareResource.class); - - protected String _name; - + +public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService { + private static final Logger s_logger = Logger.getLogger(VmwareResource.class); + + protected String _name; + protected final long _ops_timeout = 900000; // 15 minutes time out to time protected final int _shutdown_waitMs = 300000; // wait up to 5 minutes for shutdown @@ -789,23 +790,23 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa nicMasks &= ~(1 << publicNicInfo.first().intValue()); vmMo.setCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK, String.valueOf(nicMasks)); - HostMO hostMo = vmMo.getRunningHost(); - List networks = vmMo.getNetworksWithDetails(); - for (NetworkDetails netDetails : networks) { - if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) { - if (netDetails.getVMMorsOnNetwork() == null || netDetails.getVMMorsOnNetwork().length == 1) { - cleanupNetwork(hostMo, netDetails); - } - } - } - } - - if (s_logger.isInfoEnabled()) { - s_logger.info("ipassoc command on domain router " + privateIpAddress + " completed"); - } - } - - private void plugPublicNic(VirtualMachineMO vmMo, final String vlanId, final String vifMacAddress) throws Exception { + HostMO hostMo = vmMo.getRunningHost(); + List networks = vmMo.getNetworksWithDetails(); + for (NetworkDetails netDetails : networks) { + if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) { + if (netDetails.getVMMorsOnNetwork() == null || netDetails.getVMMorsOnNetwork().length == 1) { + cleanupNetwork(hostMo, netDetails); + } + } + } + } + + if (s_logger.isInfoEnabled()) { + s_logger.info("ipassoc command on domain router " + privateIpAddress + " completed"); + } + } + + private void plugPublicNic(VirtualMachineMO vmMo, final String vlanId, final String vifMacAddress) throws Exception { // TODO : probably need to set traffic shaping Pair networkInfo = null; @@ -1446,33 +1447,33 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if (vol.getType() != Volume.Type.ISO) { Pair volumeDsDetails = dataStoresDetails.get(vol.getPoolUuid()); assert (volumeDsDetails != null); - VirtualDevice device; - datastoreDiskPath = String.format("[%s] %s.vmdk", volumeDsDetails.second().getName(), vol.getPath()); - String chainInfo = vol.getChainInfo(); - - if (chainInfo != null && !chainInfo.isEmpty()) { - String[] diskChain = _gson.fromJson(chainInfo, String[].class); - if (diskChain == null || diskChain.length < 1) { - s_logger.warn("Empty previously-saved chain info, fall back to the original"); - device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); - } else { - s_logger.info("Attach the disk with stored chain info: " + chainInfo); - for (int j = 0; j < diskChain.length; j++) { - diskChain[j] = String.format("[%s] %s", volumeDsDetails.second().getName(), diskChain[j]); - } - - device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, diskChain, volumeDsDetails.first(), i, i + 1); - } - } else { - device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); - } - deviceConfigSpecArray[i].setDevice(device); - deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); - - if(s_logger.isDebugEnabled()) - s_logger.debug("Prepare volume at new device " + _gson.toJson(device)); - - i++; + VirtualDevice device; + datastoreDiskPath = String.format("[%s] %s.vmdk", volumeDsDetails.second().getName(), vol.getPath()); + String chainInfo = vol.getChainInfo(); + + if (chainInfo != null && !chainInfo.isEmpty()) { + String[] diskChain = _gson.fromJson(chainInfo, String[].class); + if (diskChain == null || diskChain.length < 1) { + s_logger.warn("Empty previously-saved chain info, fall back to the original"); + device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); + } else { + s_logger.info("Attach the disk with stored chain info: " + chainInfo); + for (int j = 0; j < diskChain.length; j++) { + diskChain[j] = String.format("[%s] %s", volumeDsDetails.second().getName(), diskChain[j]); + } + + device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, diskChain, volumeDsDetails.first(), i, i + 1); + } + } else { + device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); + } + deviceConfigSpecArray[i].setDevice(device); + deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); + + if(s_logger.isDebugEnabled()) + s_logger.debug("Prepare volume at new device " + _gson.toJson(device)); + + i++; } } @@ -1496,11 +1497,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa nic = VmwareHelper.prepareNicDevice(vmMo, networkInfo.first(), nicDeviceType, networkInfo.second(), nicTo.getMac(), i, i + 1, true, true); } - deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec(); - deviceConfigSpecArray[i].setDevice(nic); - deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); - - if(s_logger.isDebugEnabled()) + deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec(); + deviceConfigSpecArray[i].setDevice(nic); + deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); + + if(s_logger.isDebugEnabled()) s_logger.debug("Prepare NIC at new device " + _gson.toJson(deviceConfigSpecArray[i])); // this is really a hacking for DomR, upon DomR startup, we will reset all the NIC allocation after eth3 @@ -1672,29 +1673,29 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa } poolMors.put(vol.getPoolUuid(), new Pair (morDataStore, new DatastoreMO(context, morDataStore))); } - } - } - return poolMors; - } - - private String getVlanInfo(NicTO nicTo, String defaultVlan) { - if (nicTo.getBroadcastType() == BroadcastDomainType.Native) { - return defaultVlan; - } - - if (nicTo.getBroadcastType() == BroadcastDomainType.Vlan) { - if (nicTo.getBroadcastUri() != null) { - return nicTo.getBroadcastUri().getHost(); - } else { - s_logger.warn("BroadcastType is not claimed as VLAN, but without vlan info in broadcast URI. Use vlan info from labeling: " + defaultVlan); - return defaultVlan; - } - } - - s_logger.warn("Unrecognized broadcast type in VmwareResource, type: " + nicTo.getBroadcastType().toString() + ". Use vlan info from labeling: " + defaultVlan); - return defaultVlan; - } - + } + } + return poolMors; + } + + private String getVlanInfo(NicTO nicTo, String defaultVlan) { + if (nicTo.getBroadcastType() == BroadcastDomainType.Native) { + return defaultVlan; + } + + if (nicTo.getBroadcastType() == BroadcastDomainType.Vlan) { + if (nicTo.getBroadcastUri() != null) { + return nicTo.getBroadcastUri().getHost(); + } else { + s_logger.warn("BroadcastType is not claimed as VLAN, but without vlan info in broadcast URI. Use vlan info from labeling: " + defaultVlan); + return defaultVlan; + } + } + + s_logger.warn("Unrecognized broadcast type in VmwareResource, type: " + nicTo.getBroadcastType().toString() + ". Use vlan info from labeling: " + defaultVlan); + return defaultVlan; + } + private Pair prepareNetworkFromNicInfo(HostMO hostMo, NicTO nicTo) throws Exception { Pair switchName = getTargetSwitch(nicTo); @@ -2338,131 +2339,131 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if (pool.getType() != StoragePoolType.NetworkFilesystem && pool.getType() != StoragePoolType.VMFS) { throw new Exception("Unsupported storage pool type " + pool.getType()); - } - + } + ManagedObjectReference morDatastore = null; morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid()); if(morDatastore == null) morDatastore = hyperHost.mountDatastore(pool.getType() == StoragePoolType.VMFS, pool.getHost(), - pool.getPort(), pool.getPath(), pool.getUuid().replace("-", "")); - - assert (morDatastore != null); - DatastoreSummary summary = new DatastoreMO(getServiceContext(), morDatastore).getSummary(); - long capacity = summary.getCapacity(); - long available = summary.getFreeSpace(); - Map tInfo = new HashMap(); - ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, capacity, available, tInfo); - return answer; - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "ModifyStoragePoolCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new Answer(cmd, false, msg); - } - } - - protected Answer execute(DeleteStoragePoolCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource DeleteStoragePoolCommand: " + _gson.toJson(cmd)); - } - - StorageFilerTO pool = cmd.getPool(); + pool.getPort(), pool.getPath(), pool.getUuid().replace("-", "")); + + assert (morDatastore != null); + DatastoreSummary summary = new DatastoreMO(getServiceContext(), morDatastore).getSummary(); + long capacity = summary.getCapacity(); + long available = summary.getFreeSpace(); + Map tInfo = new HashMap(); + ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, capacity, available, tInfo); + return answer; + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "ModifyStoragePoolCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new Answer(cmd, false, msg); + } + } + + protected Answer execute(DeleteStoragePoolCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource DeleteStoragePoolCommand: " + _gson.toJson(cmd)); + } + + StorageFilerTO pool = cmd.getPool(); try { // We will leave datastore cleanup management to vCenter. Since for cluster VMFS datastore, it will always // be mounted by vCenter. - - // VmwareHypervisorHost hyperHost = this.getHyperHost(getServiceContext()); - // hyperHost.unmountDatastore(pool.getUuid()); - Answer answer = new Answer(cmd, true, "success"); - return answer; - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "DeleteStoragePoolCommand (pool: " + pool.getHost() + ", path: " + pool.getPath() + ") failed due to " + VmwareHelper.getExceptionMessage(e); - return new Answer(cmd, false, msg); - } - } - - protected Answer execute(AttachVolumeCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource AttachVolumeCommand: " + _gson.toJson(cmd)); - } - - /* - * AttachVolumeCommand { "attach":true,"vmName":"i-2-1-KY","pooltype":"NetworkFilesystem", - * "volumeFolder":"/export/home/kelven/vmware-test/primary", "volumePath":"uuid", - * "volumeName":"volume name","deviceId":1 } - */ - try { - VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); - VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); - if (vmMo == null) { - String msg = "Unable to find the VM to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); - s_logger.error(msg); - throw new Exception(msg); - } - - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); - if (morDs == null) { - String msg = "Unable to find the mounted datastore to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); - s_logger.error(msg); - throw new Exception(msg); - } - - DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs); - String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), cmd.getVolumePath()); - - AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, cmd.getDeviceId()); - if (cmd.getAttach()) { - vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs); - } else { - vmMo.removeAllSnapshots(); - vmMo.detachDisk(datastoreVolumePath, false); - } - - return answer; - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "AttachVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new AttachVolumeAnswer(cmd, msg); - } - } - - protected Answer execute(AttachIsoCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource AttachIsoCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); - VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); - if (vmMo == null) { - String msg = "Unable to find VM in vSphere to execute AttachIsoCommand, vmName: " + cmd.getVmName(); - s_logger.error(msg); - throw new Exception(msg); - } - - String storeUrl = cmd.getStoreUrl(); - if (storeUrl == null) { - if (!cmd.getIsoPath().equalsIgnoreCase("vmware-tools.iso")) { - String msg = "ISO store root url is not found in AttachIsoCommand"; - s_logger.error(msg); - throw new Exception(msg); - } else { - if (cmd.isAttach()) { - vmMo.mountToolsInstaller(); + + // VmwareHypervisorHost hyperHost = this.getHyperHost(getServiceContext()); + // hyperHost.unmountDatastore(pool.getUuid()); + Answer answer = new Answer(cmd, true, "success"); + return answer; + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "DeleteStoragePoolCommand (pool: " + pool.getHost() + ", path: " + pool.getPath() + ") failed due to " + VmwareHelper.getExceptionMessage(e); + return new Answer(cmd, false, msg); + } + } + + protected Answer execute(AttachVolumeCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource AttachVolumeCommand: " + _gson.toJson(cmd)); + } + + /* + * AttachVolumeCommand { "attach":true,"vmName":"i-2-1-KY","pooltype":"NetworkFilesystem", + * "volumeFolder":"/export/home/kelven/vmware-test/primary", "volumePath":"uuid", + * "volumeName":"volume name","deviceId":1 } + */ + try { + VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); + VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); + if (vmMo == null) { + String msg = "Unable to find the VM to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); + s_logger.error(msg); + throw new Exception(msg); + } + + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); + if (morDs == null) { + String msg = "Unable to find the mounted datastore to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); + s_logger.error(msg); + throw new Exception(msg); + } + + DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs); + String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), cmd.getVolumePath()); + + AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, cmd.getDeviceId()); + if (cmd.getAttach()) { + vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs); + } else { + vmMo.removeAllSnapshots(); + vmMo.detachDisk(datastoreVolumePath, false); + } + + return answer; + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "AttachVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new AttachVolumeAnswer(cmd, msg); + } + } + + protected Answer execute(AttachIsoCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource AttachIsoCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); + VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); + if (vmMo == null) { + String msg = "Unable to find VM in vSphere to execute AttachIsoCommand, vmName: " + cmd.getVmName(); + s_logger.error(msg); + throw new Exception(msg); + } + + String storeUrl = cmd.getStoreUrl(); + if (storeUrl == null) { + if (!cmd.getIsoPath().equalsIgnoreCase("vmware-tools.iso")) { + String msg = "ISO store root url is not found in AttachIsoCommand"; + s_logger.error(msg); + throw new Exception(msg); + } else { + if (cmd.isAttach()) { + vmMo.mountToolsInstaller(); } else { vmMo.unmountToolsInstaller(); } @@ -2509,223 +2510,223 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa String msg = "AttachIsoCommand(detach) failed due to " + VmwareHelper.getExceptionMessage(e); s_logger.warn(msg, e); return new Answer(cmd, false, msg); - } - } - } - - private synchronized ManagedObjectReference prepareSecondaryDatastoreOnHost(String storeUrl) throws Exception { - String storeName = getSecondaryDatastoreUUID(storeUrl); - URI uri = new URI(storeUrl); - - VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); - ManagedObjectReference morDatastore = hyperHost.mountDatastore(false, uri.getHost(), 0, uri.getPath(), storeName.replace("-", "")); - + } + } + } + + private synchronized ManagedObjectReference prepareSecondaryDatastoreOnHost(String storeUrl) throws Exception { + String storeName = getSecondaryDatastoreUUID(storeUrl); + URI uri = new URI(storeUrl); + + VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); + ManagedObjectReference morDatastore = hyperHost.mountDatastore(false, uri.getHost(), 0, uri.getPath(), storeName.replace("-", "")); + if (morDatastore == null) - throw new Exception("Unable to mount secondary storage on host. storeUrl: " + storeUrl); - - return morDatastore; - } - - private static String getSecondaryDatastoreUUID(String storeUrl) { - return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString(); - } - - protected Answer execute(ValidateSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource ValidateSnapshotCommand: " + _gson.toJson(cmd)); - } - - // the command is no longer available - String expectedSnapshotBackupUuid = null; - String actualSnapshotBackupUuid = null; - String actualSnapshotUuid = null; - return new ValidateSnapshotAnswer(cmd, false, "ValidateSnapshotCommand is not supported for vmware yet", expectedSnapshotBackupUuid, actualSnapshotBackupUuid, actualSnapshotUuid); - } - - protected Answer execute(ManageSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource ManageSnapshotCommand: " + _gson.toJson(cmd)); - } - - long snapshotId = cmd.getSnapshotId(); - - /* - * "ManageSnapshotCommand", - * "{\"_commandSwitch\":\"-c\",\"_volumePath\":\"i-2-3-KY-ROOT\",\"_snapshotName\":\"i-2-3-KY_i-2-3-KY-ROOT_20101102203827\",\"_snapshotId\":1,\"_vmName\":\"i-2-3-KY\"}" - */ - boolean success = false; - String cmdSwitch = cmd.getCommandSwitch(); - String snapshotOp = "Unsupported snapshot command." + cmdSwitch; - if (cmdSwitch.equals(ManageSnapshotCommand.CREATE_SNAPSHOT)) { - snapshotOp = "create"; - } else if (cmdSwitch.equals(ManageSnapshotCommand.DESTROY_SNAPSHOT)) { - snapshotOp = "destroy"; - } - - String details = "ManageSnapshotCommand operation: " + snapshotOp + " Failed for snapshotId: " + snapshotId; - String snapshotUUID = null; + throw new Exception("Unable to mount secondary storage on host. storeUrl: " + storeUrl); + + return morDatastore; + } + + private static String getSecondaryDatastoreUUID(String storeUrl) { + return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString(); + } + + protected Answer execute(ValidateSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource ValidateSnapshotCommand: " + _gson.toJson(cmd)); + } + + // the command is no longer available + String expectedSnapshotBackupUuid = null; + String actualSnapshotBackupUuid = null; + String actualSnapshotUuid = null; + return new ValidateSnapshotAnswer(cmd, false, "ValidateSnapshotCommand is not supported for vmware yet", expectedSnapshotBackupUuid, actualSnapshotBackupUuid, actualSnapshotUuid); + } + + protected Answer execute(ManageSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource ManageSnapshotCommand: " + _gson.toJson(cmd)); + } + + long snapshotId = cmd.getSnapshotId(); + + /* + * "ManageSnapshotCommand", + * "{\"_commandSwitch\":\"-c\",\"_volumePath\":\"i-2-3-KY-ROOT\",\"_snapshotName\":\"i-2-3-KY_i-2-3-KY-ROOT_20101102203827\",\"_snapshotId\":1,\"_vmName\":\"i-2-3-KY\"}" + */ + boolean success = false; + String cmdSwitch = cmd.getCommandSwitch(); + String snapshotOp = "Unsupported snapshot command." + cmdSwitch; + if (cmdSwitch.equals(ManageSnapshotCommand.CREATE_SNAPSHOT)) { + snapshotOp = "create"; + } else if (cmdSwitch.equals(ManageSnapshotCommand.DESTROY_SNAPSHOT)) { + snapshotOp = "destroy"; + } + + String details = "ManageSnapshotCommand operation: " + snapshotOp + " Failed for snapshotId: " + snapshotId; + String snapshotUUID = null; // snapshot operation (create or destroy) is handled inside BackupSnapshotCommand(), we just fake // a success return here snapshotUUID = UUID.randomUUID().toString(); success = true; details = null; - - return new ManageSnapshotAnswer(cmd, snapshotId, snapshotUUID, success, details); - } - - protected Answer execute(BackupSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource BackupSnapshotCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - - return mgr.getStorageManager().execute(this, cmd); - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String details = "BackupSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - return new BackupSnapshotAnswer(cmd, false, details, null, true); - } - } - - - protected Answer execute(CreateVolumeFromSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource CreateVolumeFromSnapshotCommand: " + _gson.toJson(cmd)); - } - - String details = null; - boolean success = false; - String newVolumeName = UUID.randomUUID().toString(); - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - return mgr.getStorageManager().execute(this, cmd); - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - details = "CreateVolumeFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - } - - return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); - } - - protected Answer execute(CreatePrivateTemplateFromVolumeCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource CreatePrivateTemplateFromVolumeCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - - return mgr.getStorageManager().execute(this, cmd); - - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String details = "CreatePrivateTemplateFromVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - return new CreatePrivateTemplateAnswer(cmd, false, details); - } - } - - protected Answer execute(final UpgradeSnapshotCommand cmd) { - return new Answer(cmd, true, "success"); - } - - protected Answer execute(CreatePrivateTemplateFromSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource CreatePrivateTemplateFromSnapshotCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - return mgr.getStorageManager().execute(this, cmd); - - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String details = "CreatePrivateTemplateFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - return new CreatePrivateTemplateAnswer(cmd, false, details); - } - } - - protected Answer execute(GetStorageStatsCommand cmd) { - if (s_logger.isTraceEnabled()) { - s_logger.trace("Executing resource GetStorageStatsCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareHypervisorHost hyperHost = getHyperHost(context); - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getStorageId()); - - if (morDs != null) { - DatastoreMO datastoreMo = new DatastoreMO(context, morDs); - DatastoreSummary summary = datastoreMo.getSummary(); - assert (summary != null); - - long capacity = summary.getCapacity(); - long free = summary.getFreeSpace(); - long used = capacity - free; - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Datastore summary info, storageId: " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ", capacity: " + capacity - + ", free: " + free + ", used: " + used); - } - - if (summary.getCapacity() <= 0) { - s_logger.warn("Something is wrong with vSphere NFS datastore, rebooting ESX(ESXi) host should help"); - } - - return new GetStorageStatsAnswer(cmd, capacity, used); - } else { - String msg = "Could not find datastore for GetStorageStatsCommand storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype(); - - s_logger.error(msg); - return new GetStorageStatsAnswer(cmd, msg); - } - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "Unable to execute GetStorageStatsCommand(storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ") due to " - + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new GetStorageStatsAnswer(cmd, msg); - } - } - - protected Answer execute(GetVncPortCommand cmd) { - if (s_logger.isTraceEnabled()) { - s_logger.trace("Executing resource GetVncPortCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); + + return new ManageSnapshotAnswer(cmd, snapshotId, snapshotUUID, success, details); + } + + protected Answer execute(BackupSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource BackupSnapshotCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + + return mgr.getStorageManager().execute(this, cmd); + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String details = "BackupSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + return new BackupSnapshotAnswer(cmd, false, details, null, true); + } + } + + + protected Answer execute(CreateVolumeFromSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource CreateVolumeFromSnapshotCommand: " + _gson.toJson(cmd)); + } + + String details = null; + boolean success = false; + String newVolumeName = UUID.randomUUID().toString(); + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + return mgr.getStorageManager().execute(this, cmd); + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + details = "CreateVolumeFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + } + + return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); + } + + protected Answer execute(CreatePrivateTemplateFromVolumeCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource CreatePrivateTemplateFromVolumeCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + + return mgr.getStorageManager().execute(this, cmd); + + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String details = "CreatePrivateTemplateFromVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + return new CreatePrivateTemplateAnswer(cmd, false, details); + } + } + + protected Answer execute(final UpgradeSnapshotCommand cmd) { + return new Answer(cmd, true, "success"); + } + + protected Answer execute(CreatePrivateTemplateFromSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource CreatePrivateTemplateFromSnapshotCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + return mgr.getStorageManager().execute(this, cmd); + + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String details = "CreatePrivateTemplateFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + return new CreatePrivateTemplateAnswer(cmd, false, details); + } + } + + protected Answer execute(GetStorageStatsCommand cmd) { + if (s_logger.isTraceEnabled()) { + s_logger.trace("Executing resource GetStorageStatsCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareHypervisorHost hyperHost = getHyperHost(context); + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getStorageId()); + + if (morDs != null) { + DatastoreMO datastoreMo = new DatastoreMO(context, morDs); + DatastoreSummary summary = datastoreMo.getSummary(); + assert (summary != null); + + long capacity = summary.getCapacity(); + long free = summary.getFreeSpace(); + long used = capacity - free; + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Datastore summary info, storageId: " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ", capacity: " + capacity + + ", free: " + free + ", used: " + used); + } + + if (summary.getCapacity() <= 0) { + s_logger.warn("Something is wrong with vSphere NFS datastore, rebooting ESX(ESXi) host should help"); + } + + return new GetStorageStatsAnswer(cmd, capacity, used); + } else { + String msg = "Could not find datastore for GetStorageStatsCommand storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype(); + + s_logger.error(msg); + return new GetStorageStatsAnswer(cmd, msg); + } + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "Unable to execute GetStorageStatsCommand(storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ") due to " + + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new GetStorageStatsAnswer(cmd, msg); + } + } + + protected Answer execute(GetVncPortCommand cmd) { + if (s_logger.isTraceEnabled()) { + s_logger.trace("Executing resource GetVncPortCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); VmwareHypervisorHost hyperHost = getHyperHost(context); assert(hyperHost instanceof HostMO); VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); @@ -2794,74 +2795,74 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa } protected Answer execute(ModifySshKeysCommand cmd) { - //do not log the command contents for this command. do NOT log the ssh keys - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource ModifySshKeysCommand."); - } - - return new Answer(cmd); - } - - protected Answer execute(PoolEjectCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource PoolEjectCommand: " + _gson.toJson(cmd)); - } - - return new Answer(cmd, false, "PoolEjectCommand is not available for vmware"); - } - - @Override - public PrimaryStorageDownloadAnswer execute(PrimaryStorageDownloadCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource PrimaryStorageDownloadCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - return (PrimaryStorageDownloadAnswer) mgr.getStorageManager().execute(this, cmd); - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "PrimaryStorageDownloadCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new PrimaryStorageDownloadAnswer(msg); - } - } - - @Override - public Answer execute(DestroyCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource DestroyCommand: " + _gson.toJson(cmd)); - } - - /* - * DestroyCommand content example - * - * {"volume": {"id":5,"name":"Volume1", "mountPoint":"/export/home/kelven/vmware-test/primary", - * "path":"6bb8762f-c34c-453c-8e03-26cc246ceec4", "size":0,"type":"DATADISK","resourceType": - * "STORAGE_POOL","storagePoolType":"NetworkFilesystem", "poolId":0,"deviceId":0 } } - * - * {"volume": {"id":1, "name":"i-2-1-KY-ROOT", "mountPoint":"/export/home/kelven/vmware-test/primary", - * "path":"i-2-1-KY-ROOT","size":0,"type":"ROOT", "resourceType":"STORAGE_POOL", "storagePoolType":"NetworkFilesystem", - * "poolId":0,"deviceId":0 } } - */ - - try { - VmwareContext context = getServiceContext(); - VmwareHypervisorHost hyperHost = getHyperHost(context); - VolumeTO vol = cmd.getVolume(); - - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, vol.getPoolUuid()); - if (morDs == null) { - String msg = "Unable to find datastore based on volume mount point " + cmd.getVolume().getMountPoint(); - s_logger.error(msg); - throw new Exception(msg); - } - + //do not log the command contents for this command. do NOT log the ssh keys + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource ModifySshKeysCommand."); + } + + return new Answer(cmd); + } + + protected Answer execute(PoolEjectCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource PoolEjectCommand: " + _gson.toJson(cmd)); + } + + return new Answer(cmd, false, "PoolEjectCommand is not available for vmware"); + } + + @Override + public PrimaryStorageDownloadAnswer execute(PrimaryStorageDownloadCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource PrimaryStorageDownloadCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + return (PrimaryStorageDownloadAnswer) mgr.getStorageManager().execute(this, cmd); + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "PrimaryStorageDownloadCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new PrimaryStorageDownloadAnswer(msg); + } + } + + @Override + public Answer execute(DestroyCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource DestroyCommand: " + _gson.toJson(cmd)); + } + + /* + * DestroyCommand content example + * + * {"volume": {"id":5,"name":"Volume1", "mountPoint":"/export/home/kelven/vmware-test/primary", + * "path":"6bb8762f-c34c-453c-8e03-26cc246ceec4", "size":0,"type":"DATADISK","resourceType": + * "STORAGE_POOL","storagePoolType":"NetworkFilesystem", "poolId":0,"deviceId":0 } } + * + * {"volume": {"id":1, "name":"i-2-1-KY-ROOT", "mountPoint":"/export/home/kelven/vmware-test/primary", + * "path":"i-2-1-KY-ROOT","size":0,"type":"ROOT", "resourceType":"STORAGE_POOL", "storagePoolType":"NetworkFilesystem", + * "poolId":0,"deviceId":0 } } + */ + + try { + VmwareContext context = getServiceContext(); + VmwareHypervisorHost hyperHost = getHyperHost(context); + VolumeTO vol = cmd.getVolume(); + + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, vol.getPoolUuid()); + if (morDs == null) { + String msg = "Unable to find datastore based on volume mount point " + cmd.getVolume().getMountPoint(); + s_logger.error(msg); + throw new Exception(msg); + } + DatastoreMO dsMo = new DatastoreMO(context, morDs); ManagedObjectReference morDc = hyperHost.getHyperHostDatacenter(); @@ -3018,16 +3019,16 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa VmwareHypervisorHost hyperHost = getHyperHost(context); DatacenterMO dcMo = new DatacenterMO(context, hyperHost.getHyperHostDatacenter()); - ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid()); + ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid()); if (morDatastore == null) - throw new Exception("Unable to find datastore in vSphere"); - - DatastoreMO dsMo = new DatastoreMO(context, morDatastore); - - if (cmd.getDiskCharacteristics().getType() == Volume.Type.ROOT) { - if (cmd.getTemplateUrl() == null) { - // create a root volume for blank VM - String dummyVmName = getWorkerName(context, cmd, 0); + throw new Exception("Unable to find datastore in vSphere"); + + DatastoreMO dsMo = new DatastoreMO(context, morDatastore); + + if (cmd.getDiskCharacteristics().getType() == Volume.Type.ROOT) { + if (cmd.getTemplateUrl() == null) { + // create a root volume for blank VM + String dummyVmName = getWorkerName(context, cmd, 0); VirtualMachineMO vmMo = null; try { @@ -4027,23 +4028,23 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa _morHyperHost.setType(hostTokens[0]); _morHyperHost.set_value(hostTokens[1]); - VmwareContext context = getServiceContext(); - try { - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - mgr.setupResourceStartupParams(params); - - CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager()); + VmwareContext context = getServiceContext(); + try { + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + mgr.setupResourceStartupParams(params); + + CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager()); cfmMo.ensureCustomFieldDef("Datastore", CustomFieldConstants.CLOUD_UUID); if (mgr.getNexusVSwitchGlobalParameter()) { cfmMo.ensureCustomFieldDef("DistributedVirtualPortgroup", CustomFieldConstants.CLOUD_GC_DVP); - } else { + } else { cfmMo.ensureCustomFieldDef("Network", CustomFieldConstants.CLOUD_GC); - } + } cfmMo.ensureCustomFieldDef("VirtualMachine", CustomFieldConstants.CLOUD_UUID); cfmMo.ensureCustomFieldDef("VirtualMachine", CustomFieldConstants.CLOUD_NIC_MASK); - - VmwareHypervisorHost hostMo = this.getHyperHost(context); + + VmwareHypervisorHost hostMo = this.getHyperHost(context); _hostName = hostMo.getHyperHostName(); Map vsmCredentials; @@ -4057,17 +4058,17 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa _publicNetworkVSwitchName = mgr.getPublicVSwitchName(Long.parseLong(_dcId), HypervisorType.VMware); _guestNetworkVSwitchName = mgr.getGuestVSwitchName(Long.parseLong(_dcId), HypervisorType.VMware); } - - } catch (Exception e) { - s_logger.error("Unexpected Exception ", e); - } - + + } catch (Exception e) { + s_logger.error("Unexpected Exception ", e); + } + if(_privateNetworkVSwitchName == null) { _privateNetworkVSwitchName = (String) params.get("private.network.vswitch.name"); } - if(_publicNetworkVSwitchName == null) { + if(_publicNetworkVSwitchName == null) { _publicNetworkVSwitchName = (String) params.get("public.network.vswitch.name"); - } + } if(_guestNetworkVSwitchName == null) { _guestNetworkVSwitchName = (String) params.get("guest.network.vswitch.name"); } @@ -4102,42 +4103,42 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if(value != null && value.equalsIgnoreCase("true")) _nexusVSwitch = true; - s_logger.info("VmwareResource network configuration info. private vSwitch: " + _privateNetworkVSwitchName + ", public vSwitch: " + _publicNetworkVSwitchName + ", guest network: " - + _guestNetworkVSwitchName); - - return true; - } - - @Override - public String getName() { - return _name; - } - - @Override - public boolean start() { - return true; - } - - @Override - public boolean stop() { - return true; - } - - private VmwareContext getServiceContext() { - return getServiceContext(null); - } - - private void invalidateServiceContext() { - invalidateServiceContext(null); - } - - private VmwareHypervisorHost getHyperHost(VmwareContext context) { - return getHyperHost(context, null); - } - - @Override - public synchronized VmwareContext getServiceContext(Command cmd) { - if (_serviceContext == null) { + s_logger.info("VmwareResource network configuration info. private vSwitch: " + _privateNetworkVSwitchName + ", public vSwitch: " + _publicNetworkVSwitchName + ", guest network: " + + _guestNetworkVSwitchName); + + return true; + } + + @Override + public String getName() { + return _name; + } + + @Override + public boolean start() { + return true; + } + + @Override + public boolean stop() { + return true; + } + + private VmwareContext getServiceContext() { + return getServiceContext(null); + } + + private void invalidateServiceContext() { + invalidateServiceContext(null); + } + + private VmwareHypervisorHost getHyperHost(VmwareContext context) { + return getHyperHost(context, null); + } + + @Override + public synchronized VmwareContext getServiceContext(Command cmd) { + if (_serviceContext == null) { try { _serviceContext = VmwareContextFactory.create(_vCenterAddress, _username, _password); VmwareHypervisorHost hyperHost = getHyperHost(_serviceContext, cmd); @@ -4162,23 +4163,23 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if(bRefresh) firewallMo.refreshFirewall(); } - } catch (Exception e) { - s_logger.error("Unable to connect to vSphere server: " + _vCenterAddress, e); - throw new CloudRuntimeException("Unable to connect to vSphere server: " + _vCenterAddress); - } - } - return _serviceContext; - } - - @Override - public synchronized void invalidateServiceContext(VmwareContext context) { - if (_serviceContext != null) { - _serviceContext.close(); - } - _serviceContext = null; - } - - @Override + } catch (Exception e) { + s_logger.error("Unable to connect to vSphere server: " + _vCenterAddress, e); + throw new CloudRuntimeException("Unable to connect to vSphere server: " + _vCenterAddress); + } + } + return _serviceContext; + } + + @Override + public synchronized void invalidateServiceContext(VmwareContext context) { + if (_serviceContext != null) { + _serviceContext.close(); + } + _serviceContext = null; + } + + @Override public VmwareHypervisorHost getHyperHost(VmwareContext context, Command cmd) { if (_morHyperHost.getType().equalsIgnoreCase("HostSystem")) { return new HostMO(context, _morHyperHost); diff --git a/api/src/com/cloud/network/CiscoNexusVSMDevice.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDevice.java similarity index 97% rename from api/src/com/cloud/network/CiscoNexusVSMDevice.java rename to plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDevice.java index db0db55fa7d..c58a6a77a77 100644 --- a/api/src/com/cloud/network/CiscoNexusVSMDevice.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDevice.java @@ -14,59 +14,59 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.network; - -public interface CiscoNexusVSMDevice { - - // This tells us whether the VSM is currently enabled or disabled. We may - // need this if we would like to carry out any sort of maintenance on the - // VSM or CS. - public enum VSMDeviceState { - Enabled, - Disabled - } - - // This tells us whether the VSM is currently configured with a standby (HA) - // or does not have any standby (Standalone). - public enum VSMConfigMode { - Standalone, - HA - } - - // This tells us whether the VSM is currently a primary or a standby VSM. - public enum VSMConfigState { - Primary, - Standby - } - - long getId(); - - public String getvsmName(); - - public long getHostId(); - - public String getUserName(); - - public String getPassword(); - - public String getipaddr(); - - public int getManagementVlan(); - - public int getControlVlan(); - - public int getPacketVlan(); - - public int getStorageVlan(); - - public long getvsmDomainId(); - - public VSMConfigMode getvsmConfigMode(); - - public VSMConfigState getvsmConfigState(); - - public VSMDeviceState getvsmDeviceState(); - - public String getUuid(); - -} +package com.cloud.network; + +public interface CiscoNexusVSMDevice { + + // This tells us whether the VSM is currently enabled or disabled. We may + // need this if we would like to carry out any sort of maintenance on the + // VSM or CS. + public enum VSMDeviceState { + Enabled, + Disabled + } + + // This tells us whether the VSM is currently configured with a standby (HA) + // or does not have any standby (Standalone). + public enum VSMConfigMode { + Standalone, + HA + } + + // This tells us whether the VSM is currently a primary or a standby VSM. + public enum VSMConfigState { + Primary, + Standby + } + + long getId(); + + public String getvsmName(); + + public long getHostId(); + + public String getUserName(); + + public String getPassword(); + + public String getipaddr(); + + public int getManagementVlan(); + + public int getControlVlan(); + + public int getPacketVlan(); + + public int getStorageVlan(); + + public long getvsmDomainId(); + + public VSMConfigMode getvsmConfigMode(); + + public VSMConfigState getvsmConfigState(); + + public VSMDeviceState getvsmDeviceState(); + + public String getUuid(); + +} diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java similarity index 72% rename from server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java index e00564f1f10..69638587f7a 100644 --- a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java @@ -21,6 +21,8 @@ import org.apache.log4j.Logger; import com.cloud.agent.api.StartupCommand; import com.cloud.api.ApiConstants; +import com.cloud.configuration.Config; +import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.ClusterDetailsDao; import com.cloud.dc.ClusterVO; import com.cloud.dc.ClusterVSMMapVO; @@ -62,7 +64,8 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase { HostDetailsDao _hostDetailDao; @Inject PortProfileDao _ppDao; - + @Inject + ConfigurationDao _configDao; private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalLoadBalancerDeviceManagerImpl.class); @@ -312,4 +315,94 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase { // TODO Auto-generated method stub return null; } + + @DB + public boolean vliadateVsmCluster(String vsmIp, String vsmUser, String vsmPassword, long clusterId, String clusterName) throws ResourceInUseException { + // Check if we're associating a Cisco Nexus VSM with a vmware cluster. + if (Boolean.parseBoolean(_configDao.getValue(Config.VmwareUseNexusVSwitch.toString()))) { + + if(vsmIp != null && vsmUser != null && vsmPassword != null) { + NetconfHelper netconfClient; + try { + netconfClient = new NetconfHelper(vsmIp, vsmUser, vsmPassword); + netconfClient.disconnect(); + } catch (CloudRuntimeException e) { + String msg = "Invalid credentials supplied for user " + vsmUser + " for Cisco Nexus 1000v VSM at " + vsmIp; + s_logger.error(msg); + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(msg); + } + + Transaction txn; + + // If VSM already exists and is mapped to a cluster, fail this operation. + CiscoNexusVSMDeviceVO vsm = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp); + if(vsm != null) { + List clusterList = _clusterVSMDao.listByVSMId(vsm.getId()); + if (clusterList != null && !clusterList.isEmpty()) { + s_logger.error("Failed to add cluster: specified Nexus VSM is already associated with another cluster"); + _clusterDao.remove(clusterId); + ResourceInUseException ex = new ResourceInUseException("Failed to add cluster: specified Nexus VSM is already associated with another cluster with specified Id"); + ex.addProxyObject("cluster", clusterList.get(0).getClusterId(), "clusterId"); + throw ex; + } + } + // persist credentials to database if the VSM entry is not already in the db. + if (_ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp) == null) { + vsm = new CiscoNexusVSMDeviceVO(vsmIp, vsmUser, vsmPassword); + txn = Transaction.currentTxn(); + try { + txn.start(); + vsm = _ciscoNexusVSMDeviceDao.persist(vsm); + txn.commit(); + } catch (Exception e) { + txn.rollback(); + s_logger.error("Failed to persist Cisco Nexus 1000v VSM details to database. Exception: " + e.getMessage()); + // Removing the cluster record which was added already because the persistence of Nexus VSM credentials has failed. + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(e.getMessage()); + } + } + // Create a mapping between the cluster and the vsm. + vsm = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp); + if (vsm != null) { + ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsm.getId()); + txn = Transaction.currentTxn(); + try { + txn.start(); + _clusterVSMDao.persist(connectorObj); + txn.commit(); + } catch (Exception e) { + txn.rollback(); + s_logger.error("Failed to associate Cisco Nexus 1000v VSM with cluster: " + clusterName + ". Exception: " + e.getMessage()); + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(e.getMessage()); + } + } + } else { + String msg; + msg = "The global parameter " + Config.VmwareUseNexusVSwitch.toString() + + " is set to \"true\". Following mandatory parameters are not specified. "; + if(vsmIp == null) { + msg += "vsmipaddress: Management IP address of Cisco Nexus 1000v dvSwitch. "; + } + if(vsmUser == null) { + msg += "vsmusername: Name of a user account with admin privileges over Cisco Nexus 1000v dvSwitch. "; + } + if(vsmPassword == null) { + if(vsmUser != null) { + msg += "vsmpassword: Password of user account " + vsmUser + ". "; + } else { + msg += "vsmpassword: Password of user account with admin privileges over Cisco Nexus 1000v dvSwitch. "; + } + } + s_logger.error(msg); + // Cleaning up the cluster record as addCluster operation failed because Nexus dvSwitch credentials are supplied. + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(msg); + } + return true; + } + return false; + } } diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java similarity index 99% rename from server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java rename to plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java index 6165ec17953..c01dae0eb0b 100644 --- a/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java @@ -58,7 +58,7 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{ @Column(name = "username") private String vsmUserName; - @Column(name = "password") + @Column(name = "password", encryptable=true) private String vsmPassword; @Column(name = "ipaddr") diff --git a/server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java similarity index 100% rename from server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java rename to plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java diff --git a/server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java b/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java similarity index 100% rename from server/src/com/cloud/network/element/CiscoNexusVSMElement.java rename to plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java b/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElementService.java similarity index 100% rename from server/src/com/cloud/network/element/CiscoNexusVSMElementService.java rename to plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElementService.java diff --git a/core/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java similarity index 100% rename from core/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java rename to plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java diff --git a/core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java similarity index 100% rename from core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java rename to plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java diff --git a/core/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java similarity index 100% rename from core/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java rename to plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java diff --git a/plugins/hypervisors/xen/.classpath b/plugins/hypervisors/xen/.classpath new file mode 100755 index 00000000000..264f1700606 --- /dev/null +++ b/plugins/hypervisors/xen/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/hypervisors/xen/.project b/plugins/hypervisors/xen/.project new file mode 100755 index 00000000000..de9e357ff0e --- /dev/null +++ b/plugins/hypervisors/xen/.project @@ -0,0 +1,23 @@ + + + Xen + + + + + + org.python.pydev.PyDevBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + org.python.pydev.pythonNature + + diff --git a/plugins/hypervisors/xen/build.xml b/plugins/hypervisors/xen/build.xml new file mode 100755 index 00000000000..377d6b77a3d --- /dev/null +++ b/plugins/hypervisors/xen/build.xml @@ -0,0 +1,135 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/ha/XenServerFencer.java b/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java similarity index 100% rename from server/src/com/cloud/ha/XenServerFencer.java rename to plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java diff --git a/server/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java similarity index 100% rename from server/src/com/cloud/hypervisor/XenServerGuru.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java diff --git a/server/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java similarity index 92% rename from server/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java index 8a6c60546d0..4fd202beedc 100755 --- a/server/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java @@ -59,6 +59,7 @@ import com.cloud.host.Status; import com.cloud.hypervisor.Hypervisor; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.xen.resource.CitrixResourceBase; +import com.cloud.hypervisor.xen.resource.XcpOssResource; import com.cloud.hypervisor.xen.resource.XcpServerResource; import com.cloud.hypervisor.xen.resource.XenServer56FP1Resource; import com.cloud.hypervisor.xen.resource.XenServer56Resource; @@ -253,8 +254,15 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L String hostAddr = record.address; String prodVersion = record.softwareVersion.get("product_version"); + if (prodVersion == null) { + prodVersion = record.softwareVersion.get("platform_version"); + } String xenVersion = record.softwareVersion.get("xen"); String hostOS = record.softwareVersion.get("product_brand"); + if (hostOS == null) { + hostOS = record.softwareVersion.get("platform_name"); + } + String hostOSVer = prodVersion; String hostKernelVer = record.softwareVersion.get("linux"); @@ -400,34 +408,49 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L } protected CitrixResourceBase createServerResource(long dcId, Long podId, Host.Record record) { - String prodBrand = record.softwareVersion.get("product_brand").trim(); - String prodVersion = record.softwareVersion.get("product_version").trim(); - - if(prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4") )) - return new XcpServerResource(); + String prodBrand = record.softwareVersion.get("product_brand"); + if (prodBrand == null) { + prodBrand = record.softwareVersion.get("platform_name").trim(); + } else { + prodBrand = prodBrand.trim(); + } + String prodVersion = record.softwareVersion.get("product_version"); + if (prodVersion == null) { + prodVersion = record.softwareVersion.get("platform_version").trim(); + } else { + prodVersion = prodVersion.trim(); + } - if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.0")) - return new XenServer56Resource(); - - if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0")) - return new XenServer600Resource(); - - if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2")) - return new XenServer602Resource(); + if(prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4") )) + return new XcpServerResource(); + + if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.0")) + return new XenServer56Resource(); + + if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0")) + return new XenServer600Resource(); + + if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2")) + return new XenServer602Resource(); + + if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) { + String prodVersionTextShort = record.softwareVersion.get("product_version_text_short").trim(); + if("5.6 SP2".equals(prodVersionTextShort)) { + return new XenServer56SP2Resource(); + } else if("5.6 FP1".equals(prodVersionTextShort)) { + return new XenServer56FP1Resource(); + } + } + + if (prodBrand.equals("XCP_Kronos")) { + return new XcpOssResource(); + } + + String msg = "Only support XCP 1.0.0, 1.1.0, 1.5 beta; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2 but this one is " + prodBrand + " " + prodVersion; + _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, msg, msg); + s_logger.debug(msg); + throw new RuntimeException(msg); - if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) { - String prodVersionTextShort = record.softwareVersion.get("product_version_text_short").trim(); - if("5.6 SP2".equals(prodVersionTextShort)) { - return new XenServer56SP2Resource(); - } else if("5.6 FP1".equals(prodVersionTextShort)) { - return new XenServer56FP1Resource(); - } - } - - String msg = "Only support XCP 1.0.0, 1.1.0, 1.5 beta; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2 but this one is " + prodBrand + " " + prodVersion; - _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, msg, msg); - s_logger.debug(msg); - throw new RuntimeException(msg); } protected void serverConfig() { @@ -457,8 +480,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L Boolean.parseBoolean(value); value = _params.get("xen.check.hvm"); - _checkHvm = value == null ? true : Boolean.parseBoolean(value); - + _checkHvm = false; _connPool = XenServerConnectionPool.getInstance(); _agentMgr.registerForHostEvents(this, true, false, true); @@ -567,7 +589,10 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L } else if("5.6 FP1".equals(prodVersionTextShort)) { resource = XenServer56FP1Resource.class.getName(); } + } else if (prodBrand.equals("XCP_Kronos")) { + resource = XcpOssResource.class.getName(); } + if( resource == null ){ String msg = "Only support XCP 1.0.0, 1.1.0, 1.5 beta; XenServer 5.6, 5.6 FP1, 5.6 SP2 and Xenserver 6.0 , 6.0.2 but this one is " + prodBrand + " " + prodVersion; s_logger.debug(msg); diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java similarity index 99% rename from core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 4776e5436b3..496aeb33020 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -286,7 +286,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe protected List _tmpDom0Vif = new ArrayList(); public enum SRType { - NFS, LVM, ISCSI, ISO, LVMOISCSI, LVMOHBA, EXT; + NFS, LVM, ISCSI, ISO, LVMOISCSI, LVMOHBA, EXT, FILE; String _str; @@ -941,7 +941,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (speed != null) { int cpuWeight = _maxWeight; //cpu_weight - int utilization = 0; // max CPU cap, default is unlimited + long utilization = 0; // max CPU cap, default is unlimited // weight based allocation cpuWeight = (int)((speed*0.99) / _host.speed * _maxWeight); @@ -950,11 +950,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } if (vmSpec.getLimitCpuUse()) { - utilization = (int)((speed*0.99) / _host.speed * 100); + utilization = ((long)speed * 100 * vmSpec.getCpus()) / _host.speed ; } vcpuParams.put("weight", Integer.toString(cpuWeight)); - vcpuParams.put("cap", Integer.toString(utilization)); + vcpuParams.put("cap", Long.toString(utilization)); } @@ -1066,7 +1066,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } protected VBD createPatchVbd(Connection conn, String vmName, VM vm) throws XmlRpcException, XenAPIException { - + if( _host.systemvmisouuid == null ) { Set srs = SR.getByNameLabel(conn, "XenServer Tools"); if( srs.size() != 1 ) { @@ -1100,8 +1100,29 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe cdromVBDR.type = Types.VbdType.CD; VBD cdromVBD = VBD.create(conn, cdromVBDR); cdromVBD.insert(conn, VDI.getByUuid(conn, _host.systemvmisouuid)); + + return cdromVBD; + } - return cdromVBD; + protected void destroyPatchVbd(Connection conn, String vmName) throws XmlRpcException, XenAPIException { + try { + if( !vmName.startsWith("r-") && !vmName.startsWith("s-") && !vmName.startsWith("v-") ) { + return; + } + Set vms = VM.getByNameLabel(conn, vmName); + for ( VM vm : vms ) { + Set vbds = vm.getVBDs(conn); + for( VBD vbd : vbds ) { + if (vbd.getType(conn) == Types.VbdType.CD ) { + vbd.eject(conn); + vbd.destroy(conn); + break; + } + } + } + } catch (Exception e) { + s_logger.debug("Cannot destory CD-ROM device for VM " + vmName + " due to " + e.toString(), e); + } } protected CheckSshAnswer execute(CheckSshCommand cmd) { @@ -1119,6 +1140,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (result != null) { return new CheckSshAnswer(cmd, "Can not ping System vm " + vmName + "due to:" + result); } + destroyPatchVbd(conn, vmName); } catch (Exception e) { return new CheckSshAnswer(cmd, e); } @@ -2683,7 +2705,15 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe callHostPlugin(conn, "vmopsSnapshot", "unmountSnapshotsDir", "dcId", dcId.toString()); setupLinkLocalNetwork(conn); - + // try to destroy CD-ROM device for all system VMs on this host + try { + Host host = Host.getByUuid(conn, _host.uuid); + Set vms = host.getResidentVMs(conn); + for ( VM vm : vms ) { + destroyPatchVbd(conn, vm.getNameLabel(conn)); + } + } catch (Exception e) { + } try { boolean result = cleanupHaltedVms(conn); if (!result) { @@ -3840,7 +3870,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe Map map = SR.getAllRecords(conn); for (Map.Entry entry : map.entrySet()) { SR.Record srRec = entry.getValue(); - if (SRType.EXT.equals(srRec.type)) { + if (SRType.FILE.equals(srRec.type) || SRType.EXT.equals(srRec.type)) { Set pbds = srRec.PBDs; if (pbds == null) { continue; @@ -3872,6 +3902,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe SR lvmsr = getLocalLVMSR(conn); if (lvmsr != null) { try { + _host.localSRuuid = lvmsr.getUuid(conn); + String lvmuuid = lvmsr.getUuid(conn); long cap = lvmsr.getPhysicalSize(conn); if (cap > 0) { @@ -3902,6 +3934,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (extsr != null) { try { String extuuid = extsr.getUuid(conn); + _host.localSRuuid = extuuid; long cap = extsr.getPhysicalSize(conn); if (cap > 0) { long avail = cap - extsr.getPhysicalUtilisation(conn); @@ -3926,6 +3959,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe s_logger.warn(msg); } } + return null; } @@ -4003,7 +4037,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe break; } Host.Record hr = myself.getRecord(conn); - _host.product_version = hr.softwareVersion.get("product_version").trim(); + + _host.product_version = hr.softwareVersion.get("product_version"); + if (_host.product_version == null) { + _host.product_version = hr.softwareVersion.get("platform_version"); + } else { + _host.product_version = _host.product_version.trim(); + } XsLocalNetwork privateNic = getManagementNetwork(conn); _privateNetworkName = privateNic.getNetworkRecord(conn).nameLabel; @@ -4463,8 +4503,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } finally { sshConnection.close(); } + hr.tags.add("vmops-version-" + version); host.setTags(conn, hr.tags); + return true; } catch (XenAPIException e) { String msg = "Xen setup failed due to " + e.toString(); @@ -5076,13 +5118,19 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (details == null) { details = new HashMap(); } - details.put("product_brand", hr.softwareVersion.get("product_brand")); - details.put("product_version", hr.softwareVersion.get("product_version")); + + String productBrand = hr.softwareVersion.get("product_brand"); + if (productBrand == null) { + productBrand = hr.softwareVersion.get("platform_name"); + } + details.put("product_brand", productBrand); + details.put("product_version", _host.product_version); + if( hr.softwareVersion.get("product_version_text_short") != null ) { details.put("product_version_text_short", hr.softwareVersion.get("product_version_text_short")); cmd.setHypervisorVersion(hr.softwareVersion.get("product_version_text_short")); }else{ - cmd.setHypervisorVersion(hr.softwareVersion.get("product_version")); + cmd.setHypervisorVersion(_host.product_version); } if (_privateNetworkName != null) { details.put("private.network.device", _privateNetworkName); @@ -5135,9 +5183,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe cmd.setPrivateMacAddress(pifr.MAC); cmd.setPrivateNetmask(pifr.netmask); } else { - String msg = "Private network " + _privateNetworkName + " doesn't have IP address, please check the host network configuration"; - s_logger.error(msg); - throw new CloudRuntimeException(msg); + cmd.setPrivateIpAddress(_host.ip); + cmd.setPrivateMacAddress(pifr.MAC); + cmd.setPrivateNetmask("255.255.255.0"); } pif = PIF.getByUuid(conn, _host.storagePif1); @@ -5300,7 +5348,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe vdir.virtualSize = dskch.getSize(); vdi = VDI.create(conn, vdir); } - VDI.Record vdir; vdir = vdi.getRecord(conn); s_logger.debug("Succesfully created VDI for " + cmd + ". Uuid = " + vdir.uuid); @@ -6734,6 +6781,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe public int speed; public int cpus; public String product_version; + public String localSRuuid; @Override public String toString() { diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java new file mode 100644 index 00000000000..d4260c72930 --- /dev/null +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java @@ -0,0 +1,166 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.hypervisor.xen.resource; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.ejb.Local; + +import org.apache.log4j.Logger; +import org.apache.xmlrpc.XmlRpcException; + +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; +import com.cloud.agent.api.NetworkUsageAnswer; +import com.cloud.agent.api.NetworkUsageCommand; +import com.cloud.agent.api.StartAnswer; +import com.cloud.agent.api.StartCommand; +import com.cloud.agent.api.StartupRoutingCommand; +import com.cloud.agent.api.StopAnswer; +import com.cloud.agent.api.StopCommand; +import com.cloud.agent.api.to.NicTO; +import com.cloud.agent.api.to.VirtualMachineTO; +import com.cloud.network.Networks.TrafficType; +import com.cloud.resource.ServerResource; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; +import com.cloud.vm.VirtualMachine; +import com.xensource.xenapi.Connection; +import com.xensource.xenapi.Types; +import com.xensource.xenapi.VBD; +import com.xensource.xenapi.VDI; +import com.xensource.xenapi.VM; +import com.xensource.xenapi.Types.XenAPIException; + +@Local(value=ServerResource.class) +public class XcpOssResource extends CitrixResourceBase { + private final static Logger s_logger = Logger.getLogger(XcpServerResource.class); + @Override + protected List getPatchFiles() { + List files = new ArrayList(); + String patch = "scripts/vm/hypervisor/xenserver/xcposs/patch"; + String patchfilePath = Script.findScript("", patch); + if (patchfilePath == null) { + throw new CloudRuntimeException("Unable to find patch file " + patch); + } + File file = new File(patchfilePath); + files.add(file); + return files; + } + + @Override + protected void fillHostInfo(Connection conn, StartupRoutingCommand cmd) { + super.fillHostInfo(conn, cmd); + cmd.setCaps(cmd.getCapabilities() + " , hvm"); + } + + @Override + protected String getGuestOsType(String stdType, boolean bootFromCD) { + return CitrixHelper.getXcpGuestOsType(stdType); + } + + protected VBD createPatchVbd(Connection conn, String vmName, VM vm) throws XmlRpcException, XenAPIException { + if (_host.localSRuuid != null) { + //create an iso vdi on it + String result = callHostPlugin(conn, "vmops", "createISOVHD", "uuid", _host.localSRuuid); + if (result == null || result.equalsIgnoreCase("Failed")) { + throw new CloudRuntimeException("can not create systemvm vdi"); + } + + Set vdis = VDI.getByNameLabel(conn, "systemvm-vdi"); + if (vdis.size() != 1) { + throw new CloudRuntimeException("can not find systemvmiso"); + } + VDI systemvmVDI = vdis.iterator().next(); + + VBD.Record cdromVBDR = new VBD.Record(); + cdromVBDR.VM = vm; + cdromVBDR.empty = false; + cdromVBDR.bootable = false; + cdromVBDR.userdevice = "3"; + cdromVBDR.mode = Types.VbdMode.RO; + cdromVBDR.type = Types.VbdType.DISK; + cdromVBDR.VDI = systemvmVDI; + VBD cdromVBD = VBD.create(conn, cdromVBDR); + return cdromVBD; + } else { + throw new CloudRuntimeException("can not find local sr"); + } + } + + + protected NetworkUsageAnswer execute(NetworkUsageCommand cmd) { + try { + Connection conn = getConnection(); + if(cmd.getOption()!=null && cmd.getOption().equals("create") ){ + String result = networkUsage(conn, cmd.getPrivateIP(), "create", null); + NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, result, 0L, 0L); + return answer; + } + long[] stats = getNetworkStats(conn, cmd.getPrivateIP()); + NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, "", stats[0], stats[1]); + return answer; + } catch (Exception ex) { + s_logger.warn("Failed to get network usage stats due to ", ex); + return new NetworkUsageAnswer(cmd, ex); + } + } + + @Override + public Answer executeRequest(Command cmd) { + if (cmd instanceof NetworkUsageCommand) { + return execute((NetworkUsageCommand) cmd); + } else { + return super.executeRequest(cmd); + } + } + + @Override + public StartAnswer execute(StartCommand cmd) { + StartAnswer answer = super.execute(cmd); + + VirtualMachineTO vmSpec = cmd.getVirtualMachine(); + if (vmSpec.getType() == VirtualMachine.Type.ConsoleProxy) { + Connection conn = getConnection(); + String publicIp = null; + for (NicTO nic : vmSpec.getNics()) { + if (nic.getType() == TrafficType.Guest) { + publicIp = nic.getIp(); + } + } + callHostPlugin(conn, "vmops", "setDNATRule", "ip", publicIp, "port", "8443", "add", "true"); + } + + return answer; + } + + @Override + public StopAnswer execute(StopCommand cmd) { + StopAnswer answer = super.execute(cmd); + String vmName = cmd.getVmName(); + if (vmName.startsWith("v-")) { + Connection conn = getConnection(); + callHostPlugin(conn, "vmops", "setDNATRule", "add", "false"); + } + return answer; + } + +} diff --git a/core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java diff --git a/plugins/network-elements/elastic-loadbalancer/.classpath b/plugins/network-elements/elastic-loadbalancer/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/network-elements/elastic-loadbalancer/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/network-elements/elastic-loadbalancer/.project b/plugins/network-elements/elastic-loadbalancer/.project new file mode 100644 index 00000000000..6165661a650 --- /dev/null +++ b/plugins/network-elements/elastic-loadbalancer/.project @@ -0,0 +1,17 @@ + + + elastic-loadbalancer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/network-elements/elastic-loadbalancer/build.xml b/plugins/network-elements/elastic-loadbalancer/build.xml new file mode 100755 index 00000000000..66e42cedbd2 --- /dev/null +++ b/plugins/network-elements/elastic-loadbalancer/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/network/ElasticLbVmMapVO.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/ElasticLbVmMapVO.java similarity index 71% rename from server/src/com/cloud/network/ElasticLbVmMapVO.java rename to plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/ElasticLbVmMapVO.java index b57d2efb1de..024dcdc09e0 100644 --- a/server/src/com/cloud/network/ElasticLbVmMapVO.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/ElasticLbVmMapVO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network; import javax.persistence.Column; diff --git a/server/src/com/cloud/network/element/ElasticLoadBalancerElement.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java similarity index 89% rename from server/src/com/cloud/network/element/ElasticLoadBalancerElement.java rename to plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java index a7ed40df194..1f9356f7ea8 100644 --- a/server/src/com/cloud/network/element/ElasticLoadBalancerElement.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.element; import java.util.HashMap; diff --git a/server/src/com/cloud/network/lb/ElasticLoadBalancerManager.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManager.java similarity index 58% rename from server/src/com/cloud/network/lb/ElasticLoadBalancerManager.java rename to plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManager.java index c74a613349e..0dc5b14a1a5 100644 --- a/server/src/com/cloud/network/lb/ElasticLoadBalancerManager.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.lb; import java.util.List; diff --git a/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java similarity index 98% rename from server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java rename to plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java index a5d9a39c547..3985c516d30 100644 --- a/server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.lb; import java.util.ArrayList; diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/dao/ElasticLbVmMapDao.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/dao/ElasticLbVmMapDao.java new file mode 100644 index 00000000000..725377c1d96 --- /dev/null +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/dao/ElasticLbVmMapDao.java @@ -0,0 +1,37 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.lb.dao; + +import java.util.List; + +import com.cloud.network.ElasticLbVmMapVO; +import com.cloud.network.LoadBalancerVO; +import com.cloud.utils.db.GenericDao; +import com.cloud.vm.DomainRouterVO; + +public interface ElasticLbVmMapDao extends GenericDao { + ElasticLbVmMapVO findOneByLbIdAndElbVmId(long lbId, long elbVmId); + ElasticLbVmMapVO findOneByIpIdAndElbVmId(long ipId, long elbVmId); + ElasticLbVmMapVO findOneByIp(long ipId); + + List listByElbVmId(long elbVmId); + List listByLbId(long lbId); + int deleteLB(long lbId); + List listUnusedElbVms(); + List listLbsForElbVm(long elbVmId); + +} diff --git a/server/src/com/cloud/network/lb/dao/ElasticLbVmMapDaoImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/dao/ElasticLbVmMapDaoImpl.java similarity index 85% rename from server/src/com/cloud/network/lb/dao/ElasticLbVmMapDaoImpl.java rename to plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/dao/ElasticLbVmMapDaoImpl.java index e256829e3c4..08c1efbd563 100644 --- a/server/src/com/cloud/network/lb/dao/ElasticLbVmMapDaoImpl.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/dao/ElasticLbVmMapDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.lb.dao; import java.util.List; diff --git a/plugins/network-elements/f5/.classpath b/plugins/network-elements/f5/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/network-elements/f5/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/testClient/.project b/plugins/network-elements/f5/.project similarity index 67% rename from tools/testClient/.project rename to plugins/network-elements/f5/.project index c6e95d9c21b..d9cfdd7ade4 100644 --- a/tools/testClient/.project +++ b/plugins/network-elements/f5/.project @@ -1,17 +1,17 @@ - testClient + f5 - org.python.pydev.PyDevBuilder + org.eclipse.jdt.core.javabuilder - org.python.pydev.pythonNature + org.eclipse.jdt.core.javanature diff --git a/plugins/network-elements/f5/build.xml b/plugins/network-elements/f5/build.xml new file mode 100755 index 00000000000..47fcb1c6181 --- /dev/null +++ b/plugins/network-elements/f5/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/api/commands/AddExternalLoadBalancerCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/AddExternalLoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/AddExternalLoadBalancerCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/AddExternalLoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/AddF5LoadBalancerCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/AddF5LoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/AddF5LoadBalancerCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/AddF5LoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/ConfigureF5LoadBalancerCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/ConfigureF5LoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ConfigureF5LoadBalancerCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/ConfigureF5LoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/DeleteExternalLoadBalancerCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/DeleteExternalLoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteExternalLoadBalancerCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/DeleteExternalLoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/DeleteF5LoadBalancerCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/DeleteF5LoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteF5LoadBalancerCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/DeleteF5LoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/ListExternalLoadBalancersCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/ListExternalLoadBalancersCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListExternalLoadBalancersCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/ListExternalLoadBalancersCmd.java diff --git a/server/src/com/cloud/api/commands/ListF5LoadBalancerNetworksCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/ListF5LoadBalancerNetworksCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListF5LoadBalancerNetworksCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/ListF5LoadBalancerNetworksCmd.java diff --git a/server/src/com/cloud/api/commands/ListF5LoadBalancersCmd.java b/plugins/network-elements/f5/src/com/cloud/api/commands/ListF5LoadBalancersCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListF5LoadBalancersCmd.java rename to plugins/network-elements/f5/src/com/cloud/api/commands/ListF5LoadBalancersCmd.java diff --git a/api/src/com/cloud/api/response/F5LoadBalancerResponse.java b/plugins/network-elements/f5/src/com/cloud/api/response/F5LoadBalancerResponse.java similarity index 100% rename from api/src/com/cloud/api/response/F5LoadBalancerResponse.java rename to plugins/network-elements/f5/src/com/cloud/api/response/F5LoadBalancerResponse.java diff --git a/server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java similarity index 100% rename from server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java rename to plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java diff --git a/server/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java similarity index 100% rename from server/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java rename to plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java diff --git a/core/src/com/cloud/network/resource/F5BigIpResource.java b/plugins/network-elements/f5/src/com/cloud/network/resource/F5BigIpResource.java similarity index 100% rename from core/src/com/cloud/network/resource/F5BigIpResource.java rename to plugins/network-elements/f5/src/com/cloud/network/resource/F5BigIpResource.java diff --git a/plugins/network-elements/juniper-srx/.classpath b/plugins/network-elements/juniper-srx/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/network-elements/juniper-srx/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/network-elements/juniper-srx/.project b/plugins/network-elements/juniper-srx/.project new file mode 100644 index 00000000000..393b575fdff --- /dev/null +++ b/plugins/network-elements/juniper-srx/.project @@ -0,0 +1,17 @@ + + + srx + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/network-elements/juniper-srx/build.xml b/plugins/network-elements/juniper-srx/build.xml new file mode 100755 index 00000000000..7b8138a2ee2 --- /dev/null +++ b/plugins/network-elements/juniper-srx/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/api/commands/AddExternalFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddExternalFirewallCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/AddExternalFirewallCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddExternalFirewallCmd.java diff --git a/server/src/com/cloud/api/commands/AddSrxFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddSrxFirewallCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/AddSrxFirewallCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddSrxFirewallCmd.java diff --git a/server/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java diff --git a/server/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java diff --git a/server/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java diff --git a/server/src/com/cloud/api/commands/ListExternalFirewallsCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListExternalFirewallsCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListExternalFirewallsCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListExternalFirewallsCmd.java diff --git a/server/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java diff --git a/server/src/com/cloud/api/commands/ListSrxFirewallsCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListSrxFirewallsCmd.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java diff --git a/api/src/com/cloud/api/response/SrxFirewallResponse.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java similarity index 100% rename from api/src/com/cloud/api/response/SrxFirewallResponse.java rename to plugins/network-elements/juniper-srx/src/com/cloud/api/response/SrxFirewallResponse.java diff --git a/server/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java similarity index 100% rename from server/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java rename to plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java diff --git a/server/src/com/cloud/network/element/JuniperSRXFirewallElementService.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXFirewallElementService.java similarity index 100% rename from server/src/com/cloud/network/element/JuniperSRXFirewallElementService.java rename to plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXFirewallElementService.java diff --git a/core/src/com/cloud/network/resource/JuniperSrxResource.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java similarity index 100% rename from core/src/com/cloud/network/resource/JuniperSrxResource.java rename to plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java diff --git a/plugins/network-elements/netscaler/.classpath b/plugins/network-elements/netscaler/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/network-elements/netscaler/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/network-elements/netscaler/.project b/plugins/network-elements/netscaler/.project new file mode 100644 index 00000000000..9ec4c239847 --- /dev/null +++ b/plugins/network-elements/netscaler/.project @@ -0,0 +1,17 @@ + + + netscaler + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/network-elements/netscaler/build.xml b/plugins/network-elements/netscaler/build.xml new file mode 100755 index 00000000000..dcf8663de4b --- /dev/null +++ b/plugins/network-elements/netscaler/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/api/commands/AddNetscalerLoadBalancerCmd.java b/plugins/network-elements/netscaler/src/com/cloud/api/commands/AddNetscalerLoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/AddNetscalerLoadBalancerCmd.java rename to plugins/network-elements/netscaler/src/com/cloud/api/commands/AddNetscalerLoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/ConfigureNetscalerLoadBalancerCmd.java b/plugins/network-elements/netscaler/src/com/cloud/api/commands/ConfigureNetscalerLoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ConfigureNetscalerLoadBalancerCmd.java rename to plugins/network-elements/netscaler/src/com/cloud/api/commands/ConfigureNetscalerLoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/DeleteNetscalerLoadBalancerCmd.java b/plugins/network-elements/netscaler/src/com/cloud/api/commands/DeleteNetscalerLoadBalancerCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteNetscalerLoadBalancerCmd.java rename to plugins/network-elements/netscaler/src/com/cloud/api/commands/DeleteNetscalerLoadBalancerCmd.java diff --git a/server/src/com/cloud/api/commands/ListNetscalerLoadBalancerNetworksCmd.java b/plugins/network-elements/netscaler/src/com/cloud/api/commands/ListNetscalerLoadBalancerNetworksCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListNetscalerLoadBalancerNetworksCmd.java rename to plugins/network-elements/netscaler/src/com/cloud/api/commands/ListNetscalerLoadBalancerNetworksCmd.java diff --git a/server/src/com/cloud/api/commands/ListNetscalerLoadBalancersCmd.java b/plugins/network-elements/netscaler/src/com/cloud/api/commands/ListNetscalerLoadBalancersCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListNetscalerLoadBalancersCmd.java rename to plugins/network-elements/netscaler/src/com/cloud/api/commands/ListNetscalerLoadBalancersCmd.java diff --git a/api/src/com/cloud/api/response/NetscalerLoadBalancerResponse.java b/plugins/network-elements/netscaler/src/com/cloud/api/response/NetscalerLoadBalancerResponse.java similarity index 100% rename from api/src/com/cloud/api/response/NetscalerLoadBalancerResponse.java rename to plugins/network-elements/netscaler/src/com/cloud/api/response/NetscalerLoadBalancerResponse.java diff --git a/server/src/com/cloud/network/NetScalerPodVO.java b/plugins/network-elements/netscaler/src/com/cloud/network/NetScalerPodVO.java similarity index 100% rename from server/src/com/cloud/network/NetScalerPodVO.java rename to plugins/network-elements/netscaler/src/com/cloud/network/NetScalerPodVO.java diff --git a/server/src/com/cloud/network/dao/NetScalerPodDao.java b/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDao.java similarity index 100% rename from server/src/com/cloud/network/dao/NetScalerPodDao.java rename to plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDao.java diff --git a/server/src/com/cloud/network/dao/NetScalerPodDaoImpl.java b/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/dao/NetScalerPodDaoImpl.java rename to plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDaoImpl.java diff --git a/server/src/com/cloud/network/element/NetscalerElement.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java similarity index 100% rename from server/src/com/cloud/network/element/NetscalerElement.java rename to plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java diff --git a/server/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java similarity index 100% rename from server/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java rename to plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java diff --git a/core/src/com/cloud/network/resource/NetscalerResource.java b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java similarity index 100% rename from core/src/com/cloud/network/resource/NetscalerResource.java rename to plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java diff --git a/plugins/network-elements/ovs/.classpath b/plugins/network-elements/ovs/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/network-elements/ovs/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/network-elements/ovs/.project b/plugins/network-elements/ovs/.project new file mode 100644 index 00000000000..0423b307112 --- /dev/null +++ b/plugins/network-elements/ovs/.project @@ -0,0 +1,17 @@ + + + ovs + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/network-elements/ovs/build.xml b/plugins/network-elements/ovs/build.xml new file mode 100755 index 00000000000..718720b7736 --- /dev/null +++ b/plugins/network-elements/ovs/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java similarity index 100% rename from server/src/com/cloud/network/element/OvsElement.java rename to plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java diff --git a/server/src/com/cloud/network/guru/OvsGuestNetworkGuru.java b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java similarity index 100% rename from server/src/com/cloud/network/guru/OvsGuestNetworkGuru.java rename to plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java diff --git a/server/src/com/cloud/network/ovs/GreTunnelException.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java similarity index 100% rename from server/src/com/cloud/network/ovs/GreTunnelException.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java diff --git a/server/src/com/cloud/network/ovs/OvsTunnelManager.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java similarity index 100% rename from server/src/com/cloud/network/ovs/OvsTunnelManager.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java diff --git a/server/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java similarity index 100% rename from server/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java diff --git a/plugins/storage-allocators/random/.classpath b/plugins/storage-allocators/random/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/storage-allocators/random/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/storage-allocators/random/.project b/plugins/storage-allocators/random/.project new file mode 100755 index 00000000000..cdb8361d0bd --- /dev/null +++ b/plugins/storage-allocators/random/.project @@ -0,0 +1,17 @@ + + + random-storage-allocator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/storage-allocators/random/build.xml b/plugins/storage-allocators/random/build.xml new file mode 100755 index 00000000000..e5fcebebbc8 --- /dev/null +++ b/plugins/storage-allocators/random/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java b/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java similarity index 100% rename from server/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java rename to plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java diff --git a/plugins/user-authenticators/ldap/.classpath b/plugins/user-authenticators/ldap/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/user-authenticators/ldap/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/user-authenticators/ldap/.project b/plugins/user-authenticators/ldap/.project new file mode 100755 index 00000000000..2f43179ec2e --- /dev/null +++ b/plugins/user-authenticators/ldap/.project @@ -0,0 +1,17 @@ + + + ldap-user-authenticator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/user-authenticators/ldap/build.xml b/plugins/user-authenticators/ldap/build.xml new file mode 100755 index 00000000000..c0ae8b89d18 --- /dev/null +++ b/plugins/user-authenticators/ldap/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/server/auth/LDAPUserAuthenticator.java b/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java similarity index 100% rename from server/src/com/cloud/server/auth/LDAPUserAuthenticator.java rename to plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java diff --git a/plugins/user-authenticators/md5/.classpath b/plugins/user-authenticators/md5/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/user-authenticators/md5/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/user-authenticators/md5/.project b/plugins/user-authenticators/md5/.project new file mode 100755 index 00000000000..2565593397d --- /dev/null +++ b/plugins/user-authenticators/md5/.project @@ -0,0 +1,17 @@ + + + md5-user-authenticator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/user-authenticators/md5/build.xml b/plugins/user-authenticators/md5/build.xml new file mode 100755 index 00000000000..eee2fc70bff --- /dev/null +++ b/plugins/user-authenticators/md5/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/server/auth/MD5UserAuthenticator.java b/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java similarity index 100% rename from server/src/com/cloud/server/auth/MD5UserAuthenticator.java rename to plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java diff --git a/plugins/user-authenticators/plain-text/.classpath b/plugins/user-authenticators/plain-text/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/user-authenticators/plain-text/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/user-authenticators/plain-text/.project b/plugins/user-authenticators/plain-text/.project new file mode 100755 index 00000000000..98414afbab5 --- /dev/null +++ b/plugins/user-authenticators/plain-text/.project @@ -0,0 +1,17 @@ + + + plaintext-user-authenticator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/user-authenticators/plain-text/build.xml b/plugins/user-authenticators/plain-text/build.xml new file mode 100755 index 00000000000..a59bb5d9e65 --- /dev/null +++ b/plugins/user-authenticators/plain-text/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/server/auth/PlainTextUserAuthenticator.java b/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java similarity index 97% rename from server/src/com/cloud/server/auth/PlainTextUserAuthenticator.java rename to plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java index 11de1e76632..f05a8cd815f 100644 --- a/server/src/com/cloud/server/auth/PlainTextUserAuthenticator.java +++ b/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java @@ -1,87 +1,87 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.server.auth; - -import java.math.BigInteger; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Map; - -import javax.ejb.Local; -import javax.naming.ConfigurationException; - -import org.apache.log4j.Logger; - -import com.cloud.server.ManagementServer; -import com.cloud.user.UserAccount; -import com.cloud.user.dao.UserAccountDao; -import com.cloud.utils.component.ComponentLocator; -import com.cloud.utils.exception.CloudRuntimeException; - - -@Local(value={UserAuthenticator.class}) -public class PlainTextUserAuthenticator extends DefaultUserAuthenticator { - public static final Logger s_logger = Logger.getLogger(PlainTextUserAuthenticator.class); - - private UserAccountDao _userAccountDao; - - @Override - public boolean authenticate(String username, String password, Long domainId, Map requestParameters ) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Retrieving user: " + username); - } - UserAccount user = _userAccountDao.getUserAccount(username, domainId); - if (user == null) { - s_logger.debug("Unable to find user with " + username + " in domain " + domainId); - return false; - } - - - MessageDigest md5; - try { - md5 = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - throw new CloudRuntimeException("Error", e); - } - md5.reset(); - BigInteger pwInt = new BigInteger(1, md5.digest(password.getBytes())); - - // make sure our MD5 hash value is 32 digits long... - StringBuffer sb = new StringBuffer(); - String pwStr = pwInt.toString(16); - int padding = 32 - pwStr.length(); - for (int i = 0; i < padding; i++) { - sb.append('0'); - } - sb.append(pwStr); - - - // Will: The MD5Authenticator is now a straight pass-through comparison of the - // the passwords because we will not assume that the password passed in has - // already been MD5 hashed. I am keeping the above code in case this requirement changes - // or people need examples of how to MD5 hash passwords in java. - if (!user.getPassword().equals(sb.toString())) { - s_logger.debug("Password does not match"); - return false; - } - return true; - } - - public boolean configure(String name, Map params) - throws ConfigurationException { - super.configure(name, params); - ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name); - _userAccountDao = locator.getDao(UserAccountDao.class); - return true; - } -} +// Copyright 2012 Citrix Systems, Inc. Licensed under the +// Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. Citrix Systems, Inc. +// reserves all rights not expressly granted by the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Automatically generated by addcopyright.py at 04/03/2012 +package com.cloud.server.auth; + +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Map; + +import javax.ejb.Local; +import javax.naming.ConfigurationException; + +import org.apache.log4j.Logger; + +import com.cloud.server.ManagementServer; +import com.cloud.user.UserAccount; +import com.cloud.user.dao.UserAccountDao; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.exception.CloudRuntimeException; + + +@Local(value={UserAuthenticator.class}) +public class PlainTextUserAuthenticator extends DefaultUserAuthenticator { + public static final Logger s_logger = Logger.getLogger(PlainTextUserAuthenticator.class); + + private UserAccountDao _userAccountDao; + + @Override + public boolean authenticate(String username, String password, Long domainId, Map requestParameters ) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Retrieving user: " + username); + } + UserAccount user = _userAccountDao.getUserAccount(username, domainId); + if (user == null) { + s_logger.debug("Unable to find user with " + username + " in domain " + domainId); + return false; + } + + + MessageDigest md5; + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + throw new CloudRuntimeException("Error", e); + } + md5.reset(); + BigInteger pwInt = new BigInteger(1, md5.digest(password.getBytes())); + + // make sure our MD5 hash value is 32 digits long... + StringBuffer sb = new StringBuffer(); + String pwStr = pwInt.toString(16); + int padding = 32 - pwStr.length(); + for (int i = 0; i < padding; i++) { + sb.append('0'); + } + sb.append(pwStr); + + + // Will: The MD5Authenticator is now a straight pass-through comparison of the + // the passwords because we will not assume that the password passed in has + // already been MD5 hashed. I am keeping the above code in case this requirement changes + // or people need examples of how to MD5 hash passwords in java. + if (!user.getPassword().equals(sb.toString())) { + s_logger.debug("Password does not match"); + return false; + } + return true; + } + + public boolean configure(String name, Map params) + throws ConfigurationException { + super.configure(name, params); + ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name); + _userAccountDao = locator.getDao(UserAccountDao.class); + return true; + } +} diff --git a/scripts/installer/createtmplt.sh b/scripts/installer/createtmplt.sh index ac208e69a66..bd539dd2fb8 100755 --- a/scripts/installer/createtmplt.sh +++ b/scripts/installer/createtmplt.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: createtmplt.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/installer/createtmplt.sh $ # createtmplt.sh -- install a template diff --git a/scripts/installer/createvolume.sh b/scripts/installer/createvolume.sh index cb36898d05b..af33b08c800 100755 --- a/scripts/installer/createvolume.sh +++ b/scripts/installer/createvolume.sh @@ -1,24 +1,23 @@ #!/usr/bin/env bash -# Copyright (C) 2011 Citrix Systems, Inc. All rights reserved -# -# This software is licensed under the GNU General Public License v3 or later. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# It is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# http://www.apache.org/licenses/LICENSE-2.0 # +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - # $Id: createvol.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/installer/createvolume.sh $ # createvolume.sh -- install a volume diff --git a/scripts/installer/installcentos.sh b/scripts/installer/installcentos.sh index 4f368c95dcf..e68e0577a8e 100755 --- a/scripts/installer/installcentos.sh +++ b/scripts/installer/installcentos.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: installcentos.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/installer/installcentos.sh $ # set -x diff --git a/scripts/installer/installdomp.sh b/scripts/installer/installdomp.sh index 1c243c03c73..79ea9fda45c 100755 --- a/scripts/installer/installdomp.sh +++ b/scripts/installer/installdomp.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: installdomp.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/installer/installdomp.sh $ #set -x diff --git a/scripts/installer/run_installer.sh b/scripts/installer/run_installer.sh index 44f32cdb1d9..8452e3773cb 100755 --- a/scripts/installer/run_installer.sh +++ b/scripts/installer/run_installer.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: run_installer.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/installer/run_installer.sh $ installer=$1 diff --git a/scripts/network/domr/bumpUpPriority.sh b/scripts/network/domr/bumpUpPriority.sh index 78adb746e6a..3a7eaf94e4e 100755 --- a/scripts/network/domr/bumpUpPriority.sh +++ b/scripts/network/domr/bumpUpPriority.sh @@ -1,16 +1,21 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + usage() { printf "Usage:\n %s \n" $(basename $0) >&2 diff --git a/scripts/network/domr/call_firewall.sh b/scripts/network/domr/call_firewall.sh index 9130255006e..08da3411cbe 100755 --- a/scripts/network/domr/call_firewall.sh +++ b/scripts/network/domr/call_firewall.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: call_firewall.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/branches/2.0.0/java/scripts/vm/hypervisor/xenserver/patch/call_firewall.sh $ # firewall.sh -- allow some ports / protocols to vm instances usage() { diff --git a/scripts/network/domr/call_loadbalancer.sh b/scripts/network/domr/call_loadbalancer.sh index 6875f9414fe..070947cbb15 100755 --- a/scripts/network/domr/call_loadbalancer.sh +++ b/scripts/network/domr/call_loadbalancer.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: call_loadbalancer.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/branches/2.0.0/java/scripts/vm/hypervisor/xenserver/patch/call_loadbalancer.sh $ # loadbalancer.sh -- reconfigure loadbalancer rules diff --git a/scripts/network/domr/dhcp_entry.sh b/scripts/network/domr/dhcp_entry.sh index 55fc7b2dcf1..c1bf3543dfb 100755 --- a/scripts/network/domr/dhcp_entry.sh +++ b/scripts/network/domr/dhcp_entry.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: dhcp_entry.sh 9804 2010-06-22 18:36:49Z alex $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/network/domr/dhcp_entry.sh $ # dhcp_entry.sh -- add dhcp entry on domr # @VERSION@ diff --git a/scripts/network/domr/getDomRVersion.sh b/scripts/network/domr/getDomRVersion.sh index e11e052f7a1..991cb79bad3 100755 --- a/scripts/network/domr/getDomRVersion.sh +++ b/scripts/network/domr/getDomRVersion.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. usage() { printf "Usage:\n %s \n" $(basename $0) >&2 diff --git a/scripts/network/domr/getRouterStatus.sh b/scripts/network/domr/getRouterStatus.sh index 04511b6a6f3..eb52a9b7228 100755 --- a/scripts/network/domr/getRouterStatus.sh +++ b/scripts/network/domr/getRouterStatus.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. usage() { printf "Usage:\n %s \n" $(basename $0) >&2 diff --git a/scripts/network/domr/ipassoc.sh b/scripts/network/domr/ipassoc.sh index 592b56c97f7..e4cc20eed11 100755 --- a/scripts/network/domr/ipassoc.sh +++ b/scripts/network/domr/ipassoc.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/network/domr/l2tp_vpn.sh b/scripts/network/domr/l2tp_vpn.sh index 87d9a033c0e..88f59c90317 100755 --- a/scripts/network/domr/l2tp_vpn.sh +++ b/scripts/network/domr/l2tp_vpn.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # @VERSION@ cert="/root/.ssh/id_rsa.cloud" diff --git a/scripts/network/domr/networkUsage.sh b/scripts/network/domr/networkUsage.sh index 3b1450ad902..827f944ad5c 100755 --- a/scripts/network/domr/networkUsage.sh +++ b/scripts/network/domr/networkUsage.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: networkUsage.sh 9879 2010-06-24 02:41:46Z anthony $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/hypervisor/xenserver/networkUsage.sh $ # networkUsage.sh -- create iptable rules to gather network stats usage() { diff --git a/scripts/network/domr/save_password_to_domr.sh b/scripts/network/domr/save_password_to_domr.sh index 7089075f9a0..7b29472c849 100755 --- a/scripts/network/domr/save_password_to_domr.sh +++ b/scripts/network/domr/save_password_to_domr.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: save_password_to_domr.sh 9804 2010-06-22 18:36:49Z alex $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/network/domr/save_password_to_domr.sh $ # @VERSION@ diff --git a/scripts/network/domr/vm_data.sh b/scripts/network/domr/vm_data.sh index d4c815eac17..c8617234a50 100755 --- a/scripts/network/domr/vm_data.sh +++ b/scripts/network/domr/vm_data.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: vm_data.sh 9307 2010-06-08 00:43:08Z chiradeep $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/vm/hypervisor/xenserver/patch/vm_data.sh $ # @VERSION@ diff --git a/scripts/network/exdhcp/dhcpd_edithosts.py b/scripts/network/exdhcp/dhcpd_edithosts.py index 282ce8823ab..ec64f808fbb 100644 --- a/scripts/network/exdhcp/dhcpd_edithosts.py +++ b/scripts/network/exdhcp/dhcpd_edithosts.py @@ -1,20 +1,20 @@ #!/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # Usage: dhcpd_edithosts.py mac ip hostname dns gateway nextserver diff --git a/scripts/network/exdhcp/dnsmasq_edithosts.sh b/scripts/network/exdhcp/dnsmasq_edithosts.sh index c8c3d0a509e..05285d9accf 100755 --- a/scripts/network/exdhcp/dnsmasq_edithosts.sh +++ b/scripts/network/exdhcp/dnsmasq_edithosts.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # edithosts.sh -- edit the dhcphosts file on the routing domain # $1 : the mac address # $2 : the associated ip address diff --git a/scripts/network/exdhcp/prepare_dhcpd.sh b/scripts/network/exdhcp/prepare_dhcpd.sh index 75b7dda4934..e49d0fa175b 100644 --- a/scripts/network/exdhcp/prepare_dhcpd.sh +++ b/scripts/network/exdhcp/prepare_dhcpd.sh @@ -1,21 +1,22 @@ #!/bin/sh -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # usage prepare_ping.sh subnet dhcpd_conf= diff --git a/scripts/network/exdhcp/prepare_dnsmasq.sh b/scripts/network/exdhcp/prepare_dnsmasq.sh index bc2efad04a5..70aa587e60f 100644 --- a/scripts/network/exdhcp/prepare_dnsmasq.sh +++ b/scripts/network/exdhcp/prepare_dnsmasq.sh @@ -1,20 +1,20 @@ #!/bin/sh -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # prepare dnsmasq on external dhcp server diff --git a/scripts/network/ping/prepare_tftp_bootfile.py b/scripts/network/ping/prepare_tftp_bootfile.py index cb32dfbd610..fe9bd9bf821 100644 --- a/scripts/network/ping/prepare_tftp_bootfile.py +++ b/scripts/network/ping/prepare_tftp_bootfile.py @@ -1,21 +1,22 @@ #!/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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: prepare_tftp_bootfile.py tftp_dir mac cifs_server share directory image_to_restore cifs_username cifs_password import os, sys from sys import exit diff --git a/scripts/storage/checkchildren.sh b/scripts/storage/checkchildren.sh index 2128bd5393e..55122d4f3a0 100755 --- a/scripts/storage/checkchildren.sh +++ b/scripts/storage/checkchildren.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: checkchildren.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/checkchildren.sh $ # checkchdilren.sh -- Does this path has children? diff --git a/scripts/storage/installIso.sh b/scripts/storage/installIso.sh index b43e6b89fa6..fd301bc5ca1 100755 --- a/scripts/storage/installIso.sh +++ b/scripts/storage/installIso.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: installIso.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/installIso.sh $ # installIso.sh -- install an iso diff --git a/scripts/storage/qcow2/cleanupmyvms.sh b/scripts/storage/qcow2/cleanupmyvms.sh index 34296259656..e270a01fe11 100755 --- a/scripts/storage/qcow2/cleanupmyvms.sh +++ b/scripts/storage/qcow2/cleanupmyvms.sh @@ -1,18 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/storage/qcow2/create_private_template.sh b/scripts/storage/qcow2/create_private_template.sh index 946621f65c2..4b93380bc52 100755 --- a/scripts/storage/qcow2/create_private_template.sh +++ b/scripts/storage/qcow2/create_private_template.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/storage/qcow2/createtmplt.sh b/scripts/storage/qcow2/createtmplt.sh index bc0d84fcb3d..84d2ba80b8c 100755 --- a/scripts/storage/qcow2/createtmplt.sh +++ b/scripts/storage/qcow2/createtmplt.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: createtmplt.sh 11601 2010-08-11 17:26:15Z kris $ $HeadURL: svn://svn.lab.vmops.com/repos/branches/2.1.refactor/java/scripts/storage/qcow2/createtmplt.sh $ # createtmplt.sh -- install a template diff --git a/scripts/storage/qcow2/createvm.sh b/scripts/storage/qcow2/createvm.sh index 9d855e68bfc..0971c9b9255 100755 --- a/scripts/storage/qcow2/createvm.sh +++ b/scripts/storage/qcow2/createvm.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: createvm.sh 10292 2010-07-07 00:24:04Z edison $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/createvm.sh $ # createvm.sh -- create a vm image diff --git a/scripts/storage/qcow2/createvolume.sh b/scripts/storage/qcow2/createvolume.sh index 2bc3cb29866..cfafed156f9 100755 --- a/scripts/storage/qcow2/createvolume.sh +++ b/scripts/storage/qcow2/createvolume.sh @@ -1,21 +1,20 @@ #!/usr/bin/env bash -# Copyright (C) 2011 Citrix Systems, Inc. All rights reserved -# -# This software is licensed under the GNU General Public License v3 or later. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# It is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# http://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - - +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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/scripts/storage/qcow2/delvm.sh b/scripts/storage/qcow2/delvm.sh index 68a4a69443c..6c8341c7029 100755 --- a/scripts/storage/qcow2/delvm.sh +++ b/scripts/storage/qcow2/delvm.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: delvm.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/delvm.sh $ # delvm.sh -- delete a cloned image used for a vm diff --git a/scripts/storage/qcow2/get_domr_kernel.sh b/scripts/storage/qcow2/get_domr_kernel.sh index a5e5122a7f1..d411a568dd6 100644 --- a/scripts/storage/qcow2/get_domr_kernel.sh +++ b/scripts/storage/qcow2/get_domr_kernel.sh @@ -1,21 +1,22 @@ #/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: get_domr_kernel.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/get_domr_kernel.sh $ set -x diff --git a/scripts/storage/qcow2/get_iqn.sh b/scripts/storage/qcow2/get_iqn.sh index 41eb96743e2..c8cb4c0caf1 100755 --- a/scripts/storage/qcow2/get_iqn.sh +++ b/scripts/storage/qcow2/get_iqn.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: get_iqn.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/get_iqn.sh $ # get_iqn.sh -- return iSCSI iqn of initiator (Linux) or target (OpenSolaris) diff --git a/scripts/storage/qcow2/importmpl.sh b/scripts/storage/qcow2/importmpl.sh index 48d11eae044..4e7cdae059a 100755 --- a/scripts/storage/qcow2/importmpl.sh +++ b/scripts/storage/qcow2/importmpl.sh @@ -1,21 +1,22 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: importmpl.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/importmtpl.sh $ #set -x usage() { diff --git a/scripts/storage/qcow2/listvmdisk.sh b/scripts/storage/qcow2/listvmdisk.sh index a7db64e7414..40932a27022 100755 --- a/scripts/storage/qcow2/listvmdisk.sh +++ b/scripts/storage/qcow2/listvmdisk.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: listvmdisk.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/listvmdisk.sh $ # listvmdisk.sh -- list disks of a VM diff --git a/scripts/storage/qcow2/listvmdisksize.sh b/scripts/storage/qcow2/listvmdisksize.sh index 3e1c44f7cde..2082558a2fe 100755 --- a/scripts/storage/qcow2/listvmdisksize.sh +++ b/scripts/storage/qcow2/listvmdisksize.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/storage/qcow2/listvmtmplt.sh b/scripts/storage/qcow2/listvmtmplt.sh index b6217e1988e..86e8903e6f4 100755 --- a/scripts/storage/qcow2/listvmtmplt.sh +++ b/scripts/storage/qcow2/listvmtmplt.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/storage/qcow2/listvolume.sh b/scripts/storage/qcow2/listvolume.sh index aa5a04467b5..b951b21a1bd 100755 --- a/scripts/storage/qcow2/listvolume.sh +++ b/scripts/storage/qcow2/listvolume.sh @@ -1,21 +1,20 @@ #!/usr/bin/env bash -# Copyright (C) 2011 Citrix Systems, Inc. All rights reserved -# -# This software is licensed under the GNU General Public License v3 or later. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# It is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# http://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - - +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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/scripts/storage/qcow2/managesnapshot.sh b/scripts/storage/qcow2/managesnapshot.sh index 273b8dc9990..a305ba83a98 100755 --- a/scripts/storage/qcow2/managesnapshot.sh +++ b/scripts/storage/qcow2/managesnapshot.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/storage/qcow2/managevolume.sh b/scripts/storage/qcow2/managevolume.sh index 8f25a945cee..abf8dd62dbe 100644 --- a/scripts/storage/qcow2/managevolume.sh +++ b/scripts/storage/qcow2/managevolume.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 - - +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/scripts/storage/qcow2/modifyvlan.sh b/scripts/storage/qcow2/modifyvlan.sh index a15cb196fb4..5e26af0ba02 100644 --- a/scripts/storage/qcow2/modifyvlan.sh +++ b/scripts/storage/qcow2/modifyvlan.sh @@ -1,21 +1,22 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. - - - # $Id: modifyvlan.sh 9132 2010-06-04 20:17:43Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/qcow2/modifyvlan.sh $ # modifyvlan.sh -- adds and deletes VLANs from a Routing Server # set -x diff --git a/scripts/storage/secondary/cloud-install-sys-tmplt b/scripts/storage/secondary/cloud-install-sys-tmplt index 2f282997910..12e8ea9b59d 100755 --- a/scripts/storage/secondary/cloud-install-sys-tmplt +++ b/scripts/storage/secondary/cloud-install-sys-tmplt @@ -1,7 +1,26 @@ #!/bin/bash # $Id: installrtng.sh 11251 2010-07-23 23:40:44Z abhishek $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/storage/secondary/installrtng.sh $ + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + usage() { - printf "Usage: %s: -m -f [-h ] [ -s ][-u ] [-F ] [-e